Using that example, you could change this:
function drawChart() {
// Disabling the button while the chart is drawing.
button.disabled = true;
google.visualization.events.addListener(chart, 'ready', function() {
button.disabled = false;
});
chart.draw(data, options);
}
button.onclick = function() {
var newValue = 1000 - data.getValue(0, 1);
data.setValue(0, 1, newValue);
drawChart();
}
drawChart();
to this:
// update the data and redraw the chart 5000ms (5 seconds) after the chart
finishes drawing the first time
google.visualization.events.addOneTimeListener(chart, 'ready', function () {
setTimeout(function () {
var newValue = 1000 - data.getValue(0, 1);
data.setValue(0, 1, newValue);
chart.draw(data, options);
}, 5000);
});
chart.draw(data, options);
On Monday, May 26, 2014 5:58:08 PM UTC-4, Ilya Katz wrote:
>
> Hello, I currently have two line charts with the same axis, color schemes,
> and variables. Similar to the "Value Change" example on this page,
> https://google-developers.appspot.com/chart/interactive/docs/animation ,
> I would like to transition from one chart to the other. However, instead of
> initiating this action by pressing a button, is it possible to initiate the
> transition a specified number of seconds after the chart comes into view
> for the user. Code examples using the "Value Change" example would be much
> appreciated. Thank you.
>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.