1
I have a bar graph on my system using the google Charts API. It is already working, but I have the following problem. I present in the graphs the amounts received and monthly expenses from January to December. It is presenting all the values, however, the problem is in the presentation of the numbers. When I have the value of R $ 1500,00 it presents the value 1.5. I would like to know if it is possible to change to the national currency format?
<script type="text/javascript">
google.charts.load('current', {'packages':['bar']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Mês', 'Receitas', 'Custos e Despesas'],
['Janeiro', <?php echo $recebimentoJan; ?>, <?php echo $pagamentoJan; ?>],
['Fevereiro', <?php echo $recebimentoFev; ?>, <?php echo $pagamentoFev; ?>],
['Março', <?php echo $recebimentoMar; ?>, <?php echo $pagamentoMar; ?>],
['Abril', <?php echo $recebimentoAbr; ?>, <?php echo $pagamentoAbr; ?>],
['Maio', <?php echo $recebimentoMai; ?>, <?php echo $pagamentoMai; ?>],
['Junho', <?php echo $recebimentoJun; ?>, <?php echo $pagamentoJun; ?>],
['Julho', <?php echo $recebimentoJul; ?>, <?php echo $pagamentoJul; ?>],
['Agosto', <?php echo $recebimentoAgo; ?>, <?php echo $pagamentoAgo; ?>],
['Setembro', <?php echo $recebimentoSet; ?>, <?php echo $pagamentoSet; ?>],
['Outubro', <?php echo $recebimentoOut; ?>, <?php echo $pagamentoOut; ?>],
['Novembro', <?php echo $recebimentoNov; ?>, <?php echo $pagamentoNov; ?>],
['Dezembro', <?php echo $recebimentoDez; ?>, <?php echo $pagamentoDez; ?>]
]);
var options = {
chart: {
title: 'Evolução mensal do ano de '+<?php echo $ano; ?>+''
},
bars: 'vertical'
};
var chart = new google.charts.Bar(document.getElementById('barchart'));
chart.draw(data, options);
}
</script>
You have how to share the code?
– Gabriel Coletta
I’ll share the code:
– Gustavo Vazzoler