I am making a stacked bar-chart using QuickChart. The stack loads the data from bottom to top.
I want it to be top to bottom, having my first entry at the top.
Referring to this post, I tried adding reversed like in Highcharts, but it doesn't help.
yAxis: {
reversed: true,
}
I have attached the chart output. I need "Count of A" on top. But "Count of E" is on top. The code for my chart seems to be irrelevant to post here, but if needed, I can add the code here. Please see what can I add to make it work.
This is because quickchart by default still uses V2 and V2 syntax is different so you will need to put it like this:
options: {
scales: {
yAxes: [{
ticks: {
reverse: true
}
}]
}
},
Edit:
Chart.js draws datasets in order the are in the datasets array by default (last to first if I remember correctly). So you would need to reorder your datasets.
You can also use the order property in the dataset to specify the draw order. To make the legend the way it still is you can try to accomplish it using the sort callback. If that doesn't work you will need to provide a custom generateLabels function where you can give the items back in the order you want