Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2180

QtCharts not available in PySide6 qml

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 6.4.1
    • PySide
    • None
    • windows 10 python 3.11 PySide6 6.4.1
    • Windows

    Description

      import QtCharts in qml

      import QtQuick 2.15
      import QtQuick.Controls 2.15
      import QtCharts 2.15
      
      Item {
          visible: true
          width: 640
          height: 480
      
          ChartView {
              id: chart
              title: "Top-5 car brand shares in Finland"
              anchors.fill: parent
              legend.alignment: Qt.AlignBottom
              antialiasing: true
      
              PieSeries {
                  id: pieSeries
                  PieSlice \{ label: "Volkswagen"; value: 13.5 }
                  PieSlice \{ label: "Toyota"; value: 10.9 }
                  PieSlice \{ label: "Ford"; value: 8.6 }
                  PieSlice \{ label: "Skoda"; value: 8.2 }
                  PieSlice \{ label: "Volvo"; value: 6.8 }
              }
          }
      
          Component.onCompleted: {
              // You can also manipulate slices dynamically, like append a slice or set a slice exploded
              othersSlice = pieSeries.append("Others", 52.0);
              pieSeries.find("Volkswagen").exploded = true;
          }
      }
      

      get errors: module "QtCharts" is not installed
      qml: Did not load any objects, exiting.

      Attachments

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

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            allenz allen zhu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes