How you do this depends on what you get from the new incoming data. If your new data contains all of the old data, then you can replace the DataTable used to draw the chart and redraw. If the incoming data is entirely new, then you need to add it to the existing DataTable and redraw the chart. If you have some overlap (say, you fetch the past 5 minutes of data once per minute), then you'll have to parse the incoming data to get only the new stuff, append it to the DataTable, and redraw the chart.
You can search this forum for examples of updating chart data. On Monday, June 11, 2012 6:03:22 AM UTC-4, Sunny Shah wrote: > > have a page where i keep getting data from a database periodically. > That data is depicted as a graph. At each period, i want to update the > graph with new data. Meaning that i dont want to replace the old > graph, but extend it. For example,im using a line chart which is > currently displaying. When new data comes in, i want the lines in the > chart to extend to represent the new data, but the previous lines > should remain as-is. Any idea on how to do this using the Charts API ? -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-visualization-api/-/S5JQSWdw9AAJ. 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.
