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

BarSeries: Support drawing bars downwards to show negative values

    XMLWordPrintable

Details

    Description

      Code

      import QtQuick
      import QtGraphs
      
      Window {
          width: 800
          height: 600
          visible: true
          title: "Bars"
      
          GraphsView {
              anchors.fill: parent
      
              axisX: BarCategoryAxis {
                  titleText: "Year"
                  categories: [2023, 2024, 2025]
              }
              axisY: ValueAxis {
                  titleText: "Profits"
                  min: -60
                  max: 100
              }
      
              BarSeries {
                  BarSet {
                      label: "Dept. A"
                      values: [40, -20, 80]
                  }
                  BarSet {
                      label: "Dept. B"
                      values: [60, -40, 60]
                  }
              }
          }
      }
      

      Current Result

      Desired Result

      Attachments

        1. bars-from-min.png
          18 kB
          Sze Howe Koh
        2. bars-from-zero.png
          17 kB
          Sze Howe Koh
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kagro Kaj Grönholm
            skoh-qt Sze Howe Koh
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes