QCustomPlot Discussion and Comments

Timeline on Graph (performance issue)Return to overview


I'm using QCustomPlot within a program where the user controls the display time (using a player).
So I'm using a QCPItemLine to show the current time chosen by the user on a Graph (vertical line).
The problem is that each time the current time changes, i have to change the coordinates of the QCPItemLine (x) on the graph and replot it.
As I want a line moving smoothly, I do it 16 times par second (in the worst case). But i also have a lot of data on the graph, so replotting the entire graph each time makes my program slowing down ... (even using 1.2.0 beta)

Any idea on how to improve performance, keeping a good update rate for the time line ?
(Maybe only redraw the line, as there are no zoom or movement on the graph)

Thanks :)

It might make sense for you to subclass QCustomPlot and split the drawing of the line from the rest of the plot. This will allow moving the line smoothly even if the plot contains a lot of data and replots too slow. What kind of data densities are we talking about?