PDA

View Full Version : Qwt charts wtih large data set and multiple series



deepal_de
18th September 2015, 07:30
Hi

I have a graph, in which i have to draw multiple series (7 to 15). which will have more then 50k points for one series.

the problem is that when i add 100k point to one series, qwt plot get really slow.
Re-sizing and zooming function are practically impossible at 500k points.

is there a way to handle this kind of graphs in qwt??

image is a samal example for the kind of graph with one series,
there have to be line series and point series on top of this.

11379

Thanks

Uwe
19th September 2015, 16:31
is there a way to handle this kind of graphs in qwt??
Yes, but don't expect to find a "make everything fast" flag.

Performance optimization is always a very individual thing and requires to have a certain understanding of what is taking time.
But at least here are some hints, when talking about QwtPlotCurve::Line curves:

When having a zoom level, where you can see all 500k points it is obvious, that you can reduce the number of points ( point weeding ) as many of them
are rounded to the same position on screen. When zooming you can't, but polygon clipping will speed up rendering.

a) Polygon Clipping

This is enabled as default setting for QwtPlotCurve

b) Weeding

For QwtPlotCurve::Lines you could use the Douglas Peucker algorithm ( QwtWeedingCurveFitter ) to reduce the number of points. But this is a heavy algo, that needs to be done outside of the render cycle ( number of curve points != number of points to be painted ). In SVN trunk ( a.k.a Qwt 6.2 ) you find a new flag QwtPlotCurve:: FilterPointsAggressive, that tries to unite lines ( http://zone.ni.com/reference/en-XX/help/371361H-01/lvconcepts/memory_management_for_large_data_sets ). This algo is fast and can be used inside the render cycle ( setting the attribute is all you need to to ).

Another thing you could try is setting the QwtPlotCanvas::OpenGLBuffer flag ( also SVN trunk ). Then the curves will be rendered hardware accelerated to an offscreen buffer - but with having some penalty for copying the buffer into memory afterwards. You could also try one of the native OpenGL based canvases, but the implementation of them is not yet finished.
But the probably easiest way to have hardware acceleration is using Qt4/X11 ( QApplication::setGraphicSystem( "native" ) ) - if this is an option.

Last but not least be careful with some attributes: a pen width > 1 slows down rendering significantly and antialiasing is a no-go, when rendering trillions of lines.

Uwe