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

QtCharts performance bad when min/max values changed

    XMLWordPrintable

Details

    • d3b5b6c24ae47eaa19d426ff428b8e0f58d4678c e292cd6249b347771006aa9bbeef735391e367ac 1fb4a3ef2bd86d650495e15a23c7efc1e600a59a

    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

              anmaatta Antti Määttä
              dragly Svenn-Arne Dragly
              Votes:
              5 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes