Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML Chart View
Forum Updated to NodeBB v4.3 + New Features

QML Chart View

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 4 Posters 355 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.
  • R Offline
    R Offline
    Rich Bair
    wrote on last edited by
    #1

    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

    JonBJ 1 Reply Last reply
    0
    • R Rich Bair

      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

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by
      #2

      @Rich-Bair Memory/efficiency, not a numeric limit (other than like max int).

      B 1 Reply Last reply
      0
      • JonBJ JonB

        @Rich-Bair Memory/efficiency, not a numeric limit (other than like max int).

        B Offline
        B Offline
        Beemaneni Bala 0
        wrote on last edited by
        #3

        @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 time

        property var lseries1
        ChartView{
           id: chartObj
        
           Component.onCompleted:{
            lSeries1 = chartView.createSeries(ChartView.SeriesTypeLine,         
                       qsTr("Chamber"), timeAxis, tempAxis)
           }
        }
        onDataArrival:{
           lseries1.append(x,y)
        }
        
        JonBJ B 2 Replies Last reply
        0
        • B Beemaneni Bala 0

          @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 time

          property var lseries1
          ChartView{
             id: chartObj
          
             Component.onCompleted:{
              lSeries1 = chartView.createSeries(ChartView.SeriesTypeLine,         
                         qsTr("Chamber"), timeAxis, tempAxis)
             }
          }
          onDataArrival:{
             lseries1.append(x,y)
          }
          
          JonBJ Online
          JonBJ Online
          JonB
          wrote on last edited by
          #4

          @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?

          1 Reply Last reply
          0
          • B Beemaneni Bala 0

            @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 time

            property var lseries1
            ChartView{
               id: chartObj
            
               Component.onCompleted:{
                lSeries1 = chartView.createSeries(ChartView.SeriesTypeLine,         
                           qsTr("Chamber"), timeAxis, tempAxis)
               }
            }
            onDataArrival:{
               lseries1.append(x,y)
            }
            
            B Offline
            B Offline
            Bob64
            wrote on last edited by
            #5

            @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 series lseries1 to the QML-exposed function and on the C++ side it automatically sees it as a pointer to the QXYSeries 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.

            1 Reply Last reply
            1

            • Login

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