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

QML ChartView: LineSeries and SplineSeries has a default color if width of series equals default value or 1

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.12.4
    • Fix Version/s: None
    • Component/s: Charts
    • Labels:
      None
    • Environment:
      QMake version 3.1
      Using Qt version 5.12.4
      gcc-9 9.1.0
    • Platform/s:
      Linux/X11

      Description

      import QtQuick 2.12
      import QtQuick.Window 2.12
      import QtCharts 2.3
      
      Window {
          visible: true
          width: 640
          height: 480
      
          ChartView {
              anchors.fill: parent
              ValueAxis {
                  id: xAxis
                  min: 0
                  max: 3
              }
              ValueAxis {
                  id: yAxis
                  min: -1
                  max: 2
              }
      
              LineSeries {
                  id: bugSeries
                  axisX: xAxis
                  axisY: yAxis
                  color: "black" // [1] set black color to series
                  width: 1 // [2] set value 1 to width
                  // this series has default color on plot
                  name: "Bug series"
              }
      
              LineSeries {
                  id: normalSeries
                  axisX: xAxis
                  axisY: yAxis
                  color: "black" // [3] set black color to series
                  width: 2 // [4] set value 2 to width
                  // this series has black color on plot
                  name: "Normal series"
              }
      
              Component.onCompleted: {
                  for (var i = 0; i < 300; ++i)
                  {
                      var x = i / 100
                      var y = Math.sin(x)
                      bugSeries.append(x, y)
                      normalSeries.append(x, y+1)
                  }
              }
          }
      }
      

      Expected:
      bugSeries has setted "black" color.

      Actual:
      If width of LiseSeries equals default value or 1 then LineSeries ignore setted value to property "color" and has default color.
      bugSeries has width value equals 1 and default color, normalSeries has setted "black" color.

        Attachments

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

          Activity

            People

            • Assignee:
              e0348803 Miikka Heikkinen
              Reporter:
              maxvor maxvor
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Gerrit Reviews

                There are no open Gerrit changes