react-chartjs icon indicating copy to clipboard operation
react-chartjs copied to clipboard

In Barchart, options doesn't allow stacking over y-axis.

Open ashutoshjha1409 opened this issue 9 years ago • 4 comments

Here is my code,

let chartData = { labels: ["January", "February", "March", "April", "May", "June", "July"], datasets: [ { label: "My First dataset", fillColor: "rgba(220,220,220,0.2)", strokeColor: "rgba(220,220,220,1)", pointColor: "rgba(220,220,220,1)", pointStrokeColor: "#fff", pointHighlightFill: "#fff", pointHighlightStroke: "rgba(220,220,220,1)", data: [12, 19, 3, 5, 2, 3] }, { label: "My Second dataset", fillColor: "rgba(151,187,205,0.2)", strokeColor: "rgba(151,187,205,1)", pointColor: "rgba(151,187,205,1)", pointStrokeColor: "#fff", pointHighlightFill: "#fff", pointHighlightStroke: "rgba(151,187,205,1)", data: [1, 10, 2, 9, 2, 13] } ] }; ![imageedit_2_2139895953](https://cloud.githubusercontent.com/assets/7542464/20626418/96a64246-b33f-11e6-91ba-eecf12673fa9.png) ![imageedit_2_2139895953](https://cloud.githubusercontent.com/assets/7542464/20626430/a300865a-b33f-11e6-8d2f-daaf65173289.png) var chartOptions = { enabled:true, scales: { xAxes: [{ stacked: true }], yAxes: [{ stacked: true }] } }

And here is how I'm implementing JSX. <Bar data={this.state.chartData} options={chartOptions} width="600" height="250" redraw/>

Issue is even though we set yAxes' stacked to true, it still shows bar groups. I want each dataset to stack over one another for a given interval in my case.

ashutoshjha1409 avatar Nov 25 '16 13:11 ashutoshjha1409

+1

sunlee-newyork avatar Nov 29 '16 14:11 sunlee-newyork

The same problem

PashaKoval avatar Dec 20 '16 09:12 PashaKoval

Solved #160

PashaKoval avatar Dec 20 '16 10:12 PashaKoval

Thanks @PashaKoval!

tomav avatar May 29 '17 11:05 tomav