How to optimized the data point in Qwt plot?
-
Hi,
I am using qwtplot library to plot the graph. I would like to represent more than 5 million data point on graph.
I found some solution like below.
Imagine you have 1M points and 1K pixels wide canvas (for sake of simplicity). You can't draw all 1M points, many of them will overlap in the same pixel. Divide amount of points you have by the width of the canvas (in pixels). In example above you'll end up with 1K points per canvas pixel (width-wise). All this 1K points can be represented using only two points as a single vertical line resulting in 98% compression. Just go through the points and record lowest and highest Y value, then create a line using those two values and X of the canvas pixel and you're done. Repeat it 1K times and you'll end up with 98% less data to draw.
- from http://zone.ni.com/reference/en-XX/help/371361H-01/lvconcepts/memory_management_for_large_data_sets/
section: Displaying Large Data Sets
.
how can i get width of canvas in pixel? .
i triedhandler.plot->canvas()->width();
. but it is constant if I will do Zoom in and Zoom out in graph.any other parameter can I use instead of width of the canvas, so that I can modify the chunk size with respect to zoom in and zoom out.
- from http://zone.ni.com/reference/en-XX/help/371361H-01/lvconcepts/memory_management_for_large_data_sets/
-
Hi
If you dont get any answers here, try the mailing list
https://sourceforge.net/p/qwt/mailman/
The Author hangs out there. -
@Yash001
Hi, i wish i knew the answer
but im fairly sure canvas()->width(); just returns the actual widget size and
not the zoomed area as such.Had a look in the help but didnt find the answer on how to get the extent on a zoomed canvas.