Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. [Solved]QAreaSeries not Showing up. Qt Charts
Servers for Qt installer are currently down

[Solved]QAreaSeries not Showing up. Qt Charts

Scheduled Pinned Locked Moved Unsolved Qt for Python
qt for pythonpython
2 Posts 2 Posters 449 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    Qt-Bot05
    wrote on last edited by Qt-Bot05
    #1

    I know I just posted recently but the other post was a bit dumb and I didn't try figuring out the problem first. Does this count as spam? I hope not.

    In a Qt Designer UI I created a qwidget and promoted it to
    Class Name: QChartView
    Header File: PyQt5.QtChart.h

    When I run the code below only a little box appears on the QChartView. (which I assume is the legend) But the QAreaSeries seems to be invisible.

    Here's my current code

            up = QLineSeries()
            up.append(0, 10)
    
            down = QLineSeries()
            down.append(5, 50)
    
            series = QAreaSeries(up, down)
            chart = QChart()
            chart.addSeries(series)
            self.view.setChart(chart)
    

    Tried Only having up. Didn't work.
    But here's the thing. I tried appending in a bunch of random numbers for up and down. It worked clearly but it looked distorted. Maybe I just don't know what the heck I'm doing and don't understand QAreaSeries.

    Anyways here's the random numbers.

            up = QLineSeries()
            up.append(0, 10)
            up.append(8, 69)
            up.append(4, 23)
    
            down = QLineSeries()
            down.append(5, 50)
            down.append(6, 21)
            down.append(1, 11)
    

    I tried other different numbers but only some worked so clearly there's something I don't understand

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You have here an example of how to build an area series. It's in C++ but easily translated to Python.

      I think it should provide you with the information you are looking for.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved