I am having issues with my gauge animating when changing values. Every
time I call chart.draw(), the gauge completely redraws it self instead
of animating the needle. In firefox. the gauge flashes white, then
redraws it self with the needle in the correct position, in chrome the
needle just jumps from position to position.
This is the javascript I am running.
<script type='text/javascript' src='
https://www.google.com/jsapi'></
script>
<script type='text/javascript'>
var cpm, chart, data, options;
google.load('visualization', '1', { packages: ['gauge'] });
google.setOnLoadCallback(drawChart);
function drawChart() {
data = new google.visualization.DataTable();
chart = new
google.visualization.Gauge(document.getElementById('chart_div'));
data.addColumn('string', 'Label');
data.addColumn('number', 'Value');
data.addRows(1);
data.setValue(0, 0, 'CPM');
data.setValue(0, 1, 100);
options = { width: 400, height: 400, redFrom: 600, redTo:
800,
yellowFrom: 400, yellowTo: 600, greenFrom: 200,
greenTo: 400, minorTicks: 10, majorTicks: 100, min: 0, max: 800
};
chart.draw(data, options);
setInterval(function () {
cpm = Math.floor(Math.random()*700);
data.setValue(0, 1, cpm);
chart.draw(data, options);
}, 400);
}
</script>
Thank you for all your help!
Greg