QML Chart View
-
Is there a maximum number of XY series data points a QML Chart View can hold? Is it merely memory dependent or are there other limitations?
Thanks,
-Rich@Rich-Bair Memory/efficiency, not a numeric limit (other than like max
int
). -
@Rich-Bair Memory/efficiency, not a numeric limit (other than like max
int
).@JonB
When i plot 3x line series with each around 30k points, the main thread slows down the processing. Below is the code snipped i used. After 40k it linearly decays the main thread functional behaviour i.e., the other timers / events does not fire in timeproperty var lseries1 ChartView{ id: chartObj Component.onCompleted:{ lSeries1 = chartView.createSeries(ChartView.SeriesTypeLine, qsTr("Chamber"), timeAxis, tempAxis) } } onDataArrival:{ lseries1.append(x,y) }
-
@JonB
When i plot 3x line series with each around 30k points, the main thread slows down the processing. Below is the code snipped i used. After 40k it linearly decays the main thread functional behaviour i.e., the other timers / events does not fire in timeproperty var lseries1 ChartView{ id: chartObj Component.onCompleted:{ lSeries1 = chartView.createSeries(ChartView.SeriesTypeLine, qsTr("Chamber"), timeAxis, tempAxis) } } onDataArrival:{ lseries1.append(x,y) }
@Beemaneni-Bala-0
Well, 120,000 points is quite a lot to plot and for the user to look at.In widgets rather than QML at least I think it has been noted that appending one point at a time is "slow". Don't know if you can "buffer" the points and add multiple ones at a time. Otherwise think about "thinning" your data points, do you think a user can visualize 40,000 points lying on a line?
-
@JonB
When i plot 3x line series with each around 30k points, the main thread slows down the processing. Below is the code snipped i used. After 40k it linearly decays the main thread functional behaviour i.e., the other timers / events does not fire in timeproperty var lseries1 ChartView{ id: chartObj Component.onCompleted:{ lSeries1 = chartView.createSeries(ChartView.SeriesTypeLine, qsTr("Chamber"), timeAxis, tempAxis) } } onDataArrival:{ lseries1.append(x,y) }
@Beemaneni-Bala-0 I originally used one of the examples as my model for charts - I think it was called Oscilloscope. In this, the update of the series is done in the C++ backend and, as JonB said, multiple points are added in one go.
The basic idea is that the series updating C++ function is exposed to QML, and accepts a
QXYSeries*
parameter. You simply pass your QML serieslseries1
to the QML-exposed function and on the C++ side it automatically sees it as a pointer to theQXYSeries
C++ type.Instead of having a "data arrival" signal for each point, append to a buffer in your back end and periodically notify the QML that new data is available - you can use a timer so that your update frequency is not excessive. The QML signal handler for the new data signal then calls the function I mentioned above.