Hello Team,
Below is my code and my requirement is to disable the sort.
I want the graph to be plotted like AAA[600],CCC[200],BBB[400] respectively.
But Actually it is plotting like CCC[200],BBB[400],AAA[600] based on the sum values it is plotting the graph .
Please help me out how I can Achieve my requirement .
Belowis the Code Snippet of the chart .
<script>
google.load('visualization', '1', {packages:['corechart'], callback:createCharts});
function createCharts() {
drawRolesChart();
}
function drawRolesChart() {
var data = new google.visualization.DataTable();
data.addColumn('number', 'id');
data.addColumn('string', 'customername');
data.addColumn('number', 'revenue');
data.addRow([1,'AAA', 300]);
data.addRow([2,'CCC', 200]);
data.addRow([3,'AAA', 300]);
data.addRow([4,'BBB', 400]);
var agg_MAX_REVENUE = google.visualization.data.group(data, [1],[
{'column':2, 'aggregation':google.visualization.data.sum, 'type': 'number',label:'revenue'}]);
agg_MAX_REVENUE.sort({column: 1, sort: 'disable'});
var chart = new google.visualization.ColumnChart(document.getElementById('roles_chart_sum'));
chart.draw(agg_MAX_REVENUE, {width: 400, height: 300, legend:'none'});
}
</script>
<body>
<div id="roles_chart_sum"></div>
Thanks,
Naresh