03-17-2008 05:09 AM
03-17-2008 12:26 PM
Hello Olivier,
The reason the update isn't smooth is because when you plot the first array, the graph redraws at that point, and it redraws without the second plot. Then, a few milliseconds later, it draws again when you plot the second array. This creates flashiness. To avoid that, before plotting the first array, set the ATTR_REFRESH_GRAPH attribute to FALSE. Then, after plotting both arrays, set it back to TRUE. That should result in a single drawing operation, without any flashing.
And, of course, you need to continue passing VAL_DELAYED_DRAW to the DeleteGraphPlot function, otherwise it would redraw at deletion time as well.
Speaking of the delete operation, you really should move that code under the EVENT_TIMER_TICK case. Since this is a timer callback, it doesn't make a big difference (the only other event that is sent for timer controls is EVENT_DISCARD). But in the future, new events can always be added for a control, and then your code might start deleting plots unexpectedly.
Of course I might be assuming too much about how you want to delete the plots, given that you're only deleting every other iteration.
Luis