Hello,
I'm trying google chart and i want to refresh my char every x seconds, for that i use setInterval. I don't want to use ajax but juste refresh the entire chart. is it possible ?
this is my code :
<html>
<head>
<script type="text/javascript" src="
https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
[' ', 'Aujourd\'hui','Hier'],
[ ,400,100],
[ ,460,200],
[ ,1120,300],
[ ,540,400]
]);
var options = {
vAxis: {minValue: 0}
};
var chart = new google.visualization.AreaChart(document.getElementById('chart_div'));
chart.draw(data, options);
};
drawChart();
setInterval(drawChart, 10000);
</script>
</head>
<body>
<div id="chart_div" style="width: 900px; height: 500px;"></div>
</body>
</html>
Thx