Unsolved [Solved]QAreaSeries not Showing up. Qt Charts
-
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.hWhen 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
-
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.