Hello!
I'm trying to add colors, predefined. I can not do it. I read that if I add
"{role: 'style'}", I could add the color.
"SELECT estados.estado as status, count(*) as number, estados.color as
color FROM referencias INNER JOIN estados ON referencias.status =
estados.id_estado where id_control = '$id' GROUP BY status";
Result:
Controlado 3 green
Pendiente 6 red
Here my Chart
<script type="text/javascript"
src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawChart);
function drawChart()
{
var data = google.visualization.arrayToDataTable([
['status', 'number', { role: 'style' }],
<?php
while($row = mysqli_fetch_array($resultHastaHoy))
{
//echo "['".$row["status"]."', ".$row["number"]."],";
echo "['".$row["status"]."', ".$row["number"].", '".$row["color"]."'],";
}
?>
]);
var options = {
title: 'Cumplimiento Hasta Mes Actual',
is3D:true,
pieHole: 0.4,
//colors: ['green','red']
};
var chart = new
google.visualization.PieChart(document.getElementById('piechart'));
chart.draw(data, options);
}
</script>
Thanks! For the help!
Regarts from Argentine!
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-visualization-api/833ba446-253a-411a-beae-56fe5a47d5b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.