How can I create a Stacked bar Chart
Closed this issue · 0 comments
samiahakmi commented
hi,
someone has an example to create a stacked bar chart?
I see some example:
http://www.chartjs.org/samples/latest/charts/bar/stacked.html
https://github.com/chartjs/Chart.js/blob/master/samples/charts/bar/stacked.html
and the option "stacked: true" in the axes but in dart doesn't work for me.
For the moment I'm using the version ^0.4.0+1
UPDATE:
Now works with stacked: true
// define X Axe
ChartXAxe chartScaleX = new ChartXAxe(stacked: true);
// define Y Axe
ChartYAxe chartScaleY = new ChartYAxe(stacked: true);
// set chart's data
LinearChartData data = new LinearChartData(
labels: labels,
datasets: <ChartDataSets>[
new ChartDataSets(
label: "min",
backgroundColor: barColors[0],
data: data1),
new ChartDataSets(
label: "avg",
backgroundColor: barColors[1],
data: data2),
new ChartDataSets(
label: "max",
backgroundColor: barColors[3],
data: data3)
]);