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

PySide6 QLineSeries doesn't plot correctly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 6.9.0
    • PySide
    • None
    • Linux/Wayland

    Description

      Codes for the chart

      def initChart(self):
              self.axis_x = QValueAxis()
              self.axis_x.setTitleText("x")
      
              self.axis_y = QValueAxis()
              self.axis_y.setTitleText("y")
      
              self.series = QLineSeries()
              self.series.setName("Line Series")
      
              self.series.append(0, 6)
              self.series.append(1, 4)
              self.series.append(2, 5)
      
              self.series.attachAxis(self.axis_x)
              self.series.attachAxis(self.axis_y)
      
              self.axis_x.setRange(0, 2)
              self.axis_x.setTickCount(3)
              self.axis_y.setRange(0, 6)
              self.axis_y.setTickCount(7)
      
              self.chart = QChart()
              self.chart.setAnimationOptions(QChart.AllAnimations)
              self.chart.addAxis(self.axis_x, Qt.AlignBottom)
              self.chart.addAxis(self.axis_y, Qt.AlignLeft)
              self.chart.addSeries(self.series)
      
              self.ui.chartView.setChart(self.chart)
              self.ui.chartView.setRenderHint(QPainter.Antialiasing)
      

      Result

      Attachments

        1. charts_in_cpp.7z
          2 kB
        2. charts_in_python.7z
          4 kB
        3. image-2025-04-17-16-01-48-701.png
          image-2025-04-17-16-01-48-701.png
          64 kB
        4. pyside3083_cpp_comparison.jpg
          pyside3083_cpp_comparison.jpg
          166 kB
        5. pyside3083_cpp.zip
          2 kB
        6. pyside3083.zip
          4 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            ronald ronald
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes