React-google-chart不使用选项

问题描述 投票:0回答:1

我已经制作了该图表,但问题是该图表未占用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);

工作example

我正在使用react-google-chart以图形形式显示数据(条形图),根据要求,我必须制作一个双Y轴图,我已经制作了该图,但是问题是该图是。 ..

javascript reactjs react-google-charts
1个回答
0
投票

这里要导入的是他们对Bar图表的专门评论:

© www.soinside.com 2019 - 2024. All rights reserved.