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

Method getSeries

QtChart/HorizontalPercentBarChart.py:60–82  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected