May 2019
Intermediate to advanced
542 pages
13h 37m
English
We'll start this chart view object just like we started the others in the previous sections:
class MemoryChartView(qtch.QChartView): chart_title = "Memory Usage" num_data_points = 50 def __init__(self): super().__init__() chart = qtch.QChart(title=self.chart_title) self.setChart(chart) series = qtch.QStackedBarSeries() chart.addSeries(series) self.phys_set = qtch.QBarSet("Physical") self.swap_set = qtch.QBarSet("Swap") series.append(self.phys_set) series.append(self.swap_set)
This class starts in a similar way to our disk usage chart – by subclassing QChartView, defining a chart, defining a series, and then defining some bar sets. This time, however, we are going to use QStackedBarSeries. The stacked bar is just ...
Read now
Unlock full access