【发布时间】:2021-12-31 01:57:43
【问题描述】:
我正在使用 AnyChart 的 React 库创建标签云词云。如何更改它的颜色主题? answer found here 似乎不起作用:
import React from "react";
import ReactDOM from "react-dom";
import AnyChart from "anychart-react";
import anychart from "anychart";
anychart.theme("coffee");
var data = [
{ x: "learning", value: 80 },
{ x: "includes", value: 56 },
{ x: "lists", value: 44 },
{ x: "meaning", value: 40 },
{ x: "useful", value: 36 },
{ x: "different", value: 32 },
{ x: "grammar", value: 28 },
{ x: "teaching", value: 24 },
{ x: "example", value: 20 },
{ x: "thing", value: 12 }
];
// create a chart and set the data
var chart = anychart.tagCloud(data);
//chart.theme = anychart.palettes.coffee;
ReactDOM.render(
<AnyChart width={800} height={600} instance={chart} title="Column chart" />,
document.getElementById("root")
);
完整演示is here
【问题讨论】:
标签: javascript reactjs word-cloud anychart tag-cloud