I have been working on generating an area Google chart using the code below, but I am running into an issue where Firefox is showing me a "too much recursion" error. The chart currently only has one point for testing purposes. Can anyone provide some guidance or help with this?
<?php
$equity_array = array(0);
$date_array = array(date("d/m/Y"));
$label_num = array(1);
echo"
<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([
['Time', 'Retorno'],";
echo" ['" . $date_array[0] . "', " . $equity_array[0] . "], ";
echo" ]);
var options = {
focusTarget: 'category',
chartArea: {left: 70, right:50, top: 30, bottom: 50},
series: {
0: { color: '#469DE4' },},
legend: 'none',
vAxis: {textStyle:{color: '#7F7F7F'}, baselineColor: '#CCCCCC', format: '#%', gridlines: {color: 'transparent'}},
fontName: 'Source Sans Pro',
hAxis: {textStyle:{color: '#7F7F7F'}, showTextEvery:" . $label_num . "}};
var chart = new google.visualization.AreaChart(document.getElementById('chart_div'));
var formatter = new google.visualization.NumberFormat({pattern:'#,###%'});
formatter.format(data, 1);
chart.draw(data, options);
}
</script>
<div id='chart_div' style='height: 450px;'></div>";