I am using react-google-chart
for displaying my data in graphical form (Bar Chart), As per requirement I have to make a dual-y-axis chart
I have already made that chart but the issue is that chart is not taking up the options
. It is an Bar
chart when I am putting chart as ColumnChart
then it is taking options but not rendering as dual-y-axis-chart
and if I am putting Bar
as chart type the it is not taking options
What I am missing? Here is my code:
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);
Working example
Edit
It is not even taking chartEvent
anyhow I want to achieve this things, if not react-google-chart then any other library I am open to any open source chart library.