Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Gaps in QLineSeries
Forum Update on Monday, May 27th 2025

Gaps in QLineSeries

Scheduled Pinned Locked Moved Unsolved General and Desktop
qlineserieschartcharts
5 Posts 4 Posters 1.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    fantaz
    wrote on last edited by fantaz
    #1

    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

    1 Reply Last reply
    1
    • L Offline
      L Offline
      LijoIgnatius
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • L Offline
        L Offline
        LijoIgnatius
        wrote on last edited by
        #3

        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,

        1 Reply Last reply
        0
        • D Offline
          D Offline
          DrakeM
          wrote on last edited by
          #4

          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?

          J 1 Reply Last reply
          0
          • D DrakeM

            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?

            J Offline
            J Offline
            Jussi Lind
            wrote on last edited by Jussi Lind
            #5

            @DrakeM said in Gaps in QLineSeries:

            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?

            You can generate gaps by adding qQNaN()'s to the series. However, it doesn't seem to work with append() (it ignores NaN's), but setting the whole point data at once takes NaN's into account.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved