我react-google-chart用于以图形形式(条形图)显示我的数据,根据要求,我必须制作一个dual-y-axis chart
我已经制作了那个图表,但问题是该图表没有占用options. Bar当我放置图表时它是一个图表,因为ColumnChart它正在接受选项但不呈现为dual-y-axis-chart,如果我将其Bar作为图表类型放置,则它不接受选项
我缺少什么?这是我的代码:
import React from "react";
import ReactDOM from "react-dom";
import Chart from "react-google-charts";
const data = [
["Month", "CTC", "Gross Salary", "Variation of CTC", "Total No of Employes"],
["Jan", 35000, 27000, 10000, 3],
["feb", 30000, 24000, 8000, 4],
["Mar", 50000, 37000, 7000, 5],
["May", 20000, 17000, 5000, 6],
["June", 20000, 17000, 5000, 5],
["July", 20000, 17000, 5000, 10],
["August", 20000, 17000, 5000, 7],
["Sep", 20000, 17000, 5000, 5],
["Nov", 20000, 17000, 5000, 5],
["Dec", 20000, 17000, 5000, 9]
];
const options = {
width: 900,
title: "Nearby galaxies",
curveType: "function",
series: {
3: {
axis: "test"
}
},
legend: { position: "bottom" }
};
class App extends React.Component {
render() {
return (
<div className="App">
<Chart
chartType="Bar"
width="100%"
height="400px"
data={data}
options={options}
legendToggle
/>
</div>
);
}
}
const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);
工作示例
编辑
它不是即使考虑chartEvent无论如何我想要实现这个东西,如果还没有react过来,谷歌,图表然后任何其他库我愿意接受任何开源图表库。