MCPcopy
hub / github.com/PyQt5/PyQt / getSeries

Method getSeries

QtChart/HorizontalBarChart.py:62–84  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

60 chart.legend().setAlignment(Qt.AlignBottom)
61
62 def getSeries(self):
63 # 创建5个柱子
64 set0 = QBarSet('Jane')
65 set1 = QBarSet('John')
66 set2 = QBarSet('Axel')
67 set3 = QBarSet('Mary')
68 set4 = QBarSet('Samantha')
69
70 # 添加数据
71 set0 << 1 << 2 << 3 << 4 << 5 << 6
72 set1 << 5 << 0 << 0 << 4 << 0 << 7
73 set2 << 3 << 5 << 8 << 13 << 8 << 5
74 set3 << 5 << 6 << 7 << 3 << 4 << 5
75 set4 << 9 << 7 << 5 << 3 << 1 << 2
76
77 # 创建柱状条
78 series = QHorizontalBarSeries()
79 series.append(set0)
80 series.append(set1)
81 series.append(set2)
82 series.append(set3)
83 series.append(set4)
84 return series
85
86
87if __name__ == '__main__':

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected