This is not how you are supposed to listen to the event. Use the following google.visualization.events.addListener(chart, 'statechange', handler);
On Tue, Nov 24, 2009 at 11:48 PM, Landryraccoon <[email protected]>wrote: > I have a google motion chart and I'd like to have a title that > dynamically updates if the user changes the quantities displayed. The > way I thought I'd do this is by capturing the statechange event for > the chart and then using javascript to change the title, for example > something like this: > > <script type="text/javascript" src="http://www.google.com/jsapi"></ > script> > <script type="text/javascript"> > google.load('visualization', '1', {'packages': > ['motionchart']}); > google.setOnLoadCallback(function() { > ... code snipped here ... > var chart = new google.visualization.MotionChart > (document.getElementById('divId')); > chart.draw(data, config); > var onstatechange = function() { > alert("chart state changed"); > document.getElementById('div_debug').innerHTML = > chart.getState(); > }; > chart.statechange = onstatechange; > }); > </script> > > However, this code doesn't do what I expect. I get a very pretty > motion chart, but the onstatechange callback function doesn't get > called. What should I be doing here? > > Thanks in advance. > > -- > > You received this message because you are subscribed to the Google Groups > "Google Visualization API" group. > To post to this group, send email to > [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-visualization-api%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-visualization-api?hl=en. > > > -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.
