I'm using Google Chart - stacked to create a chart on my system. Until this part is working correctly, as can be seen in the example below:
<script src="https://www.google.com/jsapi?autoload={%27modules%27:[{%27name%27:%27visualization%27,%27version%27:%271.1%27,%27packages%27:[%27bar%27]}]}.js"></script><divid="chart_div"></div>
<script>
google.setOnLoadCallback(drawChart);
function drawChart() {
var tdata = google.visualization.arrayToDataTable([
['Estados', 'Concluídos', 'Total'],
['MS', 1, 262],
['RJ', 70, 205],
['SP', 57, 176],
['MG', 0, 82]
]);
var options = {
chart: {
title: 'Gráfico Clientes',
subtitle: 'Total Clientes',
},
bars: 'horizontal', // Required for Material Bar Charts.
hAxis: { format: 'decimal' },
height: 400,
colors: ['#1b9e77', '#d95f02'],
isStacked: true
};
var chart = new google.charts.Bar(document.getElementById('chart_div'));
chart.draw(tdata, google.charts.Bar.convertOptions(options));
};
</script>
Example on JSFiddle .
My problem is while displaying the graph (completed - Total).
Example: In the state of MS I have a total value of 262 and completed of 1. In the state of RJ I have a total of 205 and completed of 70. In the graph it is adding the two dates, as can be seen in "total size of the bar". My question is: How to make the bar follow the total value only, disregarding the value of completed? I need to show the two values, but the graph bar must be in order of the Total column, not the samotory of the two.
Editing
The intention is only to show the difference within a value. For example:
In the state of RJ I own 205 clients. Of these 205, 70 are completed. As it stands, it is adding (70 + 205) and forming the bar of the graph with the size of this sum, in this case 275.
To try to explain it better, I'll add these images as an example.
This is how the chart is, as can be seen in the fiddle above:
Andthat'sthewayI'mtryingtoget:
Byobserving,onecanseethattheexpectedresultdoesnotsumtothetwobars,only"marks" a corresponding value of the total.