Represents one set of bars in a bar chart. 更多...
| import 語句: | import QtCharts 2.3 |
| 實例化: | QBarSet |
條形集包含每個類彆的一個數據值。假定集的第 1 個值屬於第 1 個類彆,第 2 個值屬於第 2 個類彆,依此類推。若集擁有的值少於類彆,假定缺少值位於集末尾。對於集中間的缺少值,使用數值 0。0 值集標簽不展示。
另請參閱 AbstractBarSeries , BarSeries , StackedBarSeries , PercentBarSeries , HorizontalBarSeries , HorizontalStackedBarSeries ,和 HorizontalPercentBarSeries .
|
borderColor : color |
The line (pen) color of the bar set.
|
borderWidth : real |
The width of the border line. By default, the width is 2.0.
|
brushFilename : string |
The name of the file used as a brush for the set.
|
color : color |
The fill (brush) color of the bar set.
|
count : int |
The number of values in the bar set.
|
label : string |
The label of the bar set.
|
labelColor : color |
The text (label) color of the bar set.
|
labelFont : font |
The font used to draw the bar set's label.
更多信息,見 font .
The values of the bar set. You can set a list of either real or point types as values.
If you set a list of real types as values, they directly define the bar set values.
If you set a list of point types as values, the x-coordinate of the point specifies its zero-based index in the bar set. The size of the bar set is the highest x-coordinate value + 1. If a point is missing for any x-coordinate between zero and the highest value, it gets the value zero.
For example, the following bar sets have equal values:
myBarSet1.values = [5, 0, 1, 5]; myBarSet2.values = [Qt.point(0, 5), Qt.point(2, 1), Qt.point(3, 5)];
|
valueChanged ( int index ) |
This signal is emitted when the value at the position specified by index 被修改。
The corresponding signal handler is
onValueChanged
.
This signal is emitted when new values are added to the bar set. index indicates the position of the first inserted value, and count is the number of inserted values.
The corresponding signal handler is
onValuesAdded
.
This signal is emitted when values are removed from the bar set. index indicates the position of the first removed value, and count is the number of removed values.
The corresponding signal handler is
onValuesRemoved
.
|
append ( real value ) |
Appends the new value specified by value to the end of the bar set.
|
at ( int index ) |
Returns the value specified by index from the bar set. If the index is out of bounds, 0.0 is returned.
|
clicked ( int index ) |
This signal is emitted when the user clicks the bar specified by index in a bar set.
The corresponding signal handler is
onClicked
.
|
doubleClicked ( int index ) |
This signal is emitted when the user double-clicks the bar specified by index in a bar set.
The corresponding signal handler is
onDoubleClicked
.
|
pressed ( int index ) |
This signal is emitted when the user clicks the bar specified by index in a bar set and holds down the mouse button.
The corresponding signal handler is
onPressed
.
|
released ( int index ) |
This signal is emitted when the user releases the mouse press on the bar specified by index in a bar set.
The corresponding signal handler is
onReleased
.
Removes the number of values specified by count from the bar set starting with the value specified by index .
If you leave out count , only the value specified by index is removed.
Adds the value specified by value to the bar set at the position specified by index .