Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-59040

QtCharts performance bad when min/max values changed

    XMLWordPrintable

    Details

      Description

      The performance of an entire QML application grinds to a halt when changing the min/max values of a ValueAxis in a ChartView often. We have multiple charts where we need to dynamically change these values as data is updated and this seems to be an issue for all of them.

      Here is a snippet of code where this issue occurs:

      ChartView {
          id: chartView
          anchors.fill: parent
          legend.visible: false
          antialiasing: true
          backgroundColor: "transparent"
          enabled: false // disables mouse input
          margins.top: 0
          margins.bottom: 0
          margins.left: 10
          margins.right: 0
      
          LineSeries {
              id: series
              axisX: axisX
              axisY: axisY
              color: chartItem.lineColor
              width: 2.0
          }
      
          LineSeries {
              id: fireSeries
              axisX: axisX
              axisY: axisY
              color: chartItem.lineColor
              width: 2.0
          }
      
          ValueAxis {
              id: axisX
              min: voltmeterRoot.minimumTime
              max: voltmeterRoot.maximumTime
              tickCount: 2
              gridVisible: false
              labelsVisible: false
              lineVisible: showAxis
          }
      
          ValueAxis {
              id: axisY
              min: voltmeterRoot.minimumValue
              max: voltmeterRoot.maximumValue
              tickCount: 2
              gridVisible: false
              labelsVisible: false
              lineVisible: showAxis
          }
      }
      

      The points of the LineSeries are added dynamically, but the performance is degraded even when no points are added to the LineSeries. It is enough to spam changes to the min/max values of the ValueAxis.

      This issue does not occur in previous versions of QtCharts. We have tested the same code with Qt 5.7.0 and Qt 5.7.1 without issues.

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              e0348803 Miikka Heikkinen
              Reporter:
              dragly Svenn-Arne Dragly
              Votes:
              4 Vote for this issue
              Watchers:
              12 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes