One way would be to have two graphs; hide the one thats being redrawn, and then show it when its ready, hiding the other one at the same time.
Im not sure of the best way to hide it. If you use "display:none" it may be smart enough to not really draw itself until you show it, which wouldnt help. In that case you could try using absolute positioning, and putting it out of the visible area while it redraws. Or you could put the two on top of each other, with an opaque div between them, and change the z-indexes as necessary. Using the latter technique you could also use script.aculo.us style blending from the one to the other (by changing the opacities of the two graphs, and the div). Mark On Feb 20, 2:40 pm, Crispin <[email protected]> wrote: > Hi Folks, > > I want to use the annotated timeline as a realtime graph. i.e. > Something that updates every n seconds. when I call the .draw method, > it flickers (actually vanishes) and then comes back with the data. Is > there a way to stop it? > > Simple code is: > var mainChartData = new google.visualization.DataTable(); > mainChartData.addColumn('datetime', 'Date'); > mainChartData.addColumn('number', 'Watts'); > mainChartData.addColumn('string', 'title1'); > mainChartData.addColumn('string', 'text1'); > > //from button. Draw the graph > function testMe2() { > var chart = new google.visualization.AnnotatedTimeLine > (document.getElementById('myusageMainGraph')); > chart.draw(mainChartData, { displayAnnotations: true }); > > } > > var f = 0; > //called from another button. will be a timer. > function testMe3() { > var chart = new google.visualization.AnnotatedTimeLine > (document.getElementById('myusageMainGraph')); > mainChartData.addRows(1); > var dt = new Date(); > dt.setDate(dt.getDate() + f); > mainChartData.setValue(f, 0, dt); > mainChartData.setValue(f, 1, f); > chart.draw(mainChartData, { displayAnnotations: true }); > //flickers. > f++; > > } > > thanks. > Crispin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
