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

Method __init__

QtChart/ScatterChart.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 self.m_dataTable = self.generateRandomData(3, 10, 7)
39
40 # 图表
41 chart = QChart()
42 self.setChart(chart)
43 # 设置标题
44 chart.setTitle('Scatter chart')
45 # 添加Series
46 self.getSeries(chart)
47 # 创建默认xy轴
48 chart.createDefaultAxes()
49 chart.legend().setVisible(False)
50
51 def getSeries(self, chart):
52 for i, data_list in enumerate(self.m_dataTable):

Callers

nothing calls this directly

Calls 4

resizeMethod · 0.95
generateRandomDataMethod · 0.95
getSeriesMethod · 0.95
setTitleMethod · 0.45

Tested by

no test coverage detected