1
In the visible part this percentage, as I do to change the percentage by the whole quantity:
Example:
As shown in the attached image instead of showing 14.3% show 1.
Follows my code:
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.setOnLoadCallback(drawSetores);
function drawSetores() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Topping');
data.addColumn('number', 'Slices');
data.addRows([
<?php
$setores = mysql_query("SELECT
distinct sol_setor AS ID,
st.setor_nome AS SETOR,
CONCAT(count(s.sol_setor)) AS QUANT
FROM
solicitacao AS s
INNER JOIN setor AS st ON s.sol_setor = st.setor_id
GROUP BY sol_setor");
while ($r = mysql_fetch_array($setores)) {
echo "['$r[1]', $r[2]],\n";
}
?>
]);
// Set options for Sarah's pie chart.
var options = {title:'SETORES',
width:550,
height:300,
is3D:true};
var chart = new google.visualization.PieChart(document.getElementById('Setores'));
chart.draw(data, options);
}
Hi Otácio, cool the question, thanks!
– Leo