0
How can I fill this chart with Mysql data?
<?php
$sql = 'SELECT * FROM historicos';
$resultado = mysqli_query($conn, $sql);
?>
<script type="text/javascript">
google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Horario', 'Sales'],
['2004', 0.500],
['2005', 0.1],
['2006', 0.200],
['2007', 0.30]
]);
var options = {
title: 'Company Performance',
curveType: 'function',
legend: { position: 'bottom' }
};
var chart = new google.visualization.LineChart(document.getElementById('curve_chart'));
chart.draw(data, options);
}
</script>
After a few adjustments it worked.. ` Function drawChart() { var data = google.visualization.arrayToDataTable([ ['Horario', 'Response time'], ]);
`
Welcome to Stack Overflow! What have you tried to do? So your question is very broad.
– Jorge B.