MCPcopy Create free account
hub / github.com/PyQt5/PyQt / __init__

Method __init__

QtChart/AreaChart.py:32–49  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

30class Window(QChartView):
31
32 def __init__(self, *args, **kwargs):
33 super(Window, self).__init__(*args, **kwargs)
34 self.resize(400, 300)
35 # 抗锯齿
36 self.setRenderHint(QPainter.Antialiasing)
37
38 # 图表
39 chart = QChart()
40 self.setChart(chart)
41 # 设置标题
42 chart.setTitle('Simple areachart example')
43 # 添加Series
44 chart.addSeries(self.getSeries())
45 # 创建默认轴线
46 chart.createDefaultAxes()
47 # 设置xy轴的范围
48 chart.axisX().setRange(0, 20)
49 chart.axisY().setRange(0, 10)
50
51 def getSeries(self):
52 # 创建Series

Callers

nothing calls this directly

Calls 4

resizeMethod · 0.95
getSeriesMethod · 0.95
setTitleMethod · 0.45
setRangeMethod · 0.45

Tested by

no test coverage detected