0
I need some help with Google Maps. I have a table where I store id, negotiator and date. I make a query to find out how many agreements that person made in the month and I can generate a graph, the problem is in putting the previous month to make the comparison. I don’t want to put it on separate charts, I want a chart only that does this, imagined comparing six months on separate charts?
Follow the code I have:
SELECT count(id) as idCont, negociador FROM acordos WHERE month(data_envio) = ".($mes)." GROUP BY negociador
$res_ma = mysql_query($sql_ma,conexao());
function drawChart2() {
var data = google.visualization.arrayToDataTable([
['Negociador', 'Acordos - <?= $row_m['mes'].'/'.$row_m['ano']; ?>'],
<?php
while($row_ma = mysql_fetch_array($res_ma)){
echo "['".$row_ma['negociador']."', '".$row_ma['idCont']."'],";
}
?>
]);
var options = {
chart: {
title: 'Desempenho da Equipe',
subtitle: 'Demonstrativo de meses anteriores',
},
bars: 'horizontal' // Required for Material Bar Charts.
};
var chart = new google.charts.Bar(document.getElementById('barchart_meses'));
chart.draw(data, google.charts.Bar.convertOptions(options));
}
Thank you for your attention.
instead of negative, I could tell you where I can improve on the question...
– smourao