(self, *args, **kwargs)
| 30 | class 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): |
nothing calls this directly
no test coverage detected