It depends on how you want it to work visually. Using the CPU in the task manager scrolls the entire graph from right to left, and this is not entirely smooth. It refreshes (for me anyway) about once per second, and when it refreshes, then the whole chart “pushes” to the side.
I did something in CF back in 1.0 days as a test, and I decided that the chart would remain static and the data lines would continue sequentially from left to right and when it reached the right edge, it would start drawing back to left again, erasing the oldest data diagrams as it progresses (e.g., ECG).
In this case, your bitmap remains basically unchanged, so you should not redraw the whole thing. I did this using cropping, which was basically a “vertical bar” or a rectangle of the height of the graph, but only, say, 10 pixels wide. I redrawn this strip with updated axis values, so the only bits that actually redraw are a small strip. In addition, an advantage has been added to make visible the “deletion” of the oldest data after I return to the beginning of the graph.
source share