May 2019
Intermediate to advanced
542 pages
13h 37m
English
The first chart we'll create is a bar chart for displaying the disk space used by each storage partition on the computer. Each detected partition will have a bar indicating what percentage of its space is being used.
Let's start by creating a class for the chart:
class DiskUsageChartView(qtch.QChartView): chart_title = 'Disk Usage by Partition' def __init__(self): super().__init__()
The class is subclassed from the QtChart.QChartView class; this subclass of QGraphicsView is a widget that can display QChart objects. Just like the Qt graphics framework, the QtChart framework is based on a model-view design. In this case, the QChart object is analogous to a QGraphicsScene object, which will be attached to the QChartView ...
Read now
Unlock full access