mirror of
https://github.com/Wolvan/poll.horse.git
synced 2024-11-21 20:47:59 +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 => {
|
||||
chart.draw(
|
||||
google.visualization.arrayToDataTable(
|
||||
[["Options", "Votes"]].concat(data)
|
||||
[["Options", "Votes"]].concat(data.sort((a, b) => b[1] - a[1]))
|
||||
), chartOptions
|
||||
);
|
||||
chartEl.style.visibility = "visible";
|
||||
|
|
Loading…
Reference in a new issue