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

QtGraphs AreaSeries inconsistent area filling

XMLWordPrintable

    • Linux/X11, Windows
    • 52c5d1d3e (dev), c0829ec48 (6.10), a9b1b878e (6.9), 517efad87 (tqtc/lts-6.8)

      Using 2D GraphsView with AreaSeries, produces some inconsistent area filling in some cases.
      Using only the UpperSeries, and Y value in the positive interval the area is not filled for the first part, when starting point is in Y = 0.

      Check following example:

       

      GraphsView {
        id: graphsView
        anchors.fill: parent  axisY: ValueAxis {
          min: 0
          max: 2
          tickInterval: 1
          subTickCount: 0
        }  axisX: ValueAxis {
          min: -60
          max: 60
        }  AreaSeries {
          color: "red"
          borderColor: "blue"
          borderWidth: 3
          upperSeries: LineSeries {
            XYPoint {x: -20; y: 0 }
            XYPoint {x: 0; y: 0 }
            XYPoint {x: 0; y: 1 }
            XYPoint {x: 10; y: 1 }
            XYPoint {x: 10; y: 0 }
            XYPoint {x: 15; y: 0 }
            XYPoint {x: 15; y: 1 }
            XYPoint {x: 20; y: 1 }
            XYPoint {x: 20; y: 0 }
            XYPoint {x: 25; y: 0 }
          }
        }
      } 

      This produces the following graph

       

      The area between (0,0) and (15,1) is not filled, even though the LineSeries border is present.

      One workaround for this issue is changing the first element's Y coordinates to something non 0. 
      Change: {{XYPoint {x: -20; y: 0 }}} -> {{XYPoint {x: -20; y: -1 }}} and the graph will look ok:

        1. image-2025-08-12-17-43-32-121.png
          17 kB
          David Vincze
        2. image-2025-08-12-17-48-38-213.png
          14 kB
          David Vincze
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            kwpark Kwanghyo Park
            vandawn David Vincze
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes