I have a Google Chart that is created from a SharePoint List. The sorting of the chart results from which items appear first when going down from row to row:
function drawBarCharts(countChoices, name) {
var rows = [];
for (var property in countChoices) {
if (countChoices.hasOwnProperty(property)) {
rows.push([property, countChoices[property]]);
}
}
var datatable = new google.visualization.DataTable();
datatable.addColumn('string', 'Type');
datatable.addColumn('number', 'Quantity');
datatable.addRows(rows);
var options = {
title: String(name),
is3D: 'true',
hAxis:{direction: -1}
};
var chart = new google.visualization.BarChart(document.getElementById(String(name)));
chart.draw(datatable, options);
How can I manually sort the data with a manual order, or by name?
Thanks!