mirror of
https://github.com/Wolvan/poll.horse.git
synced 2024-11-22 04:58:00 +01:00
Sort data in pie chart
Due to the nature of redrawing, the biggest piece of the pie chart will always be the first one. Locations are not static.
This commit is contained in:
parent
a1c4d06845
commit
8e8b263c62
1 changed files with 1 additions and 1 deletions
|
@ -28,7 +28,7 @@ function domLoaded() {
|
||||||
drawChart = data => {
|
drawChart = data => {
|
||||||
chart.draw(
|
chart.draw(
|
||||||
google.visualization.arrayToDataTable(
|
google.visualization.arrayToDataTable(
|
||||||
[["Options", "Votes"]].concat(data)
|
[["Options", "Votes"]].concat(data.sort((a, b) => b[1] - a[1]))
|
||||||
), chartOptions
|
), chartOptions
|
||||||
);
|
);
|
||||||
chartEl.style.visibility = "visible";
|
chartEl.style.visibility = "visible";
|
||||||
|
|
Loading…
Reference in a new issue