Commit 29cfef6b authored by Leo Iannacone's avatar Leo Iannacone

show distributions in alphabetical order in the charts of history page

parent f8f4fd69
...@@ -108,11 +108,10 @@ function Page_History() { ...@@ -108,11 +108,10 @@ function Page_History() {
series: [], series: [],
labels: [] labels: []
}; };
for (var distro in distributions_counter) { for (var i = 0; i < all_distributions.length; i++) {
if (distributions_counter.hasOwnProperty(distro)) { var distro = all_distributions[i];
distributions_data.series.push(distributions_counter[distro]); distributions_data.series.push(distributions_counter[distro]);
distributions_data.labels.push(distro + " (" + distributions_counter[distro] + ")"); distributions_data.labels.push(distro + " (" + distributions_counter[distro] + ")");
}
} }
Chartist.Pie('#distributions-chart', distributions_data, { Chartist.Pie('#distributions-chart', distributions_data, {
donut: true, donut: true,
...@@ -159,6 +158,7 @@ function Page_History() { ...@@ -159,6 +158,7 @@ function Page_History() {
_count_distributions(p); _count_distributions(p);
_count_days(p); _count_days(p);
} }
all_distributions.sort();
_sort_table(); _sort_table();
_create_graph_distributions(); _create_graph_distributions();
_create_graph_days(); _create_graph_days();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment