Gaps in QLineSeries



  • Hi all,
    does the QLineSeries support gaps in the data, like QCustomPlot or MS Excel does?
    I can see that invalid points are not added to the list, if they're not valid - in charthelpers_p.h isValidValue method, which is used in QXYSeries in append, insert and replace funs.
    By all means, I'm not an expert, but by looking at the QLineChartItem::updateGeometry(), one would need to put linePath.moveTo(points.at(i)); instead of linePath.lineTo(points.at(i)); when the loop finds out that the point is not to be displayed (say Y coordinate is invalid). The problem is that the QLineChartItem class is, well, private, so to speak.
    Is there a way to introduce gaps in the line chart, or whatever chart type is available, or one would need to create a list of line series items?

    cheers,
    fantaz



  • Hi fantaz,
    I want to have gaps in the data, Have you found any solution for this?. If have any idea kindly help me with this



  • You can dynamically create a new line series, keep appending data till u need gap, after gap again create a new line series and keep appending data to the recently created line series.
    Using count you can keep track of how many line series has been created, and using removeallseries/removeseries(index) you can clear the dynamically created series.

    If you have more gaps, it will affect the performance, since we are creating a line series dynamically, load time will increase.

    This how I handled the above scenario,



  • When using line series, we've had severe performance problems. We end up with thousands of series to handle all of the gaps and have to create parallel scatter series because we want icons for each point that aren't part of the standard icon set.

    We pay a huge cost both constructing and destructing the series. Seems like it may be refreshing on each add series, but even removeAllSeries is slow. Have tried many things to suspend the painting, but with no timing effect.

    Any ideas on how to have many gaps without destroying performance?