Hi Rand,
In ChartDirector, you would need to create a new chart to update the chart. That means you do not need to write additional code to update the chart, because it is the same code that creates the chart in the first place. The keeps the code simple and in practice it is just as fast as comparing to re-using the BaseChart.
Creating the BaseChart takes negligible CPU time comparing to redrawing the chart image on screen. When a new data point arrive, many things on the chart can change. For example, the axis scale may need to be extended to accommodate the data point. That means the entire chart would need to be redrawn even if you can reuse the BaseChart.
In ChartDirector, what you need to to add a new data point to your data array, then call the "drawChart" subroutine to redraw the chart.
You mentioned the data rate is 4x seconds. I assume it means 4 updates per second. At this rate you can just update the chart when new data arrive.
If the rate is much higher, you can consider to update the data array and the chart display at different rates, or to run the data array update and chart update in different threads. We have customers that need to update the data 4000 times per second. In this case, the chart should be updated at a slower rate (like 10 updates per second), because it better fit human vision capabilities, and the computer cannot refresh the screen at such high rate anyway.
Regards
Peter Kwan |