An abstract parent type for all bar series types. 更多...
import 语句: | import QtGraphs |
实例化: | QAbstractBarSeries |
继承: | |
继承者: | |
状态: | 技术预览 |
In bar graphs, bars are defined as bar sets that contain one data value for each category. The position of a bar is specified by the category and its height by the data value. Bar series that contain multiple bar sets group together bars that belong to the same category. The way the bars are displayed is determined by the subclass of this class chosen to create the bar graph.
barWidth : real |
宽度单位是 X 轴的单位。条形的最小宽度为 0,且负值被视为 0。将宽度设为 0 意味着屏幕中的条形宽度为 1 像素,不管 X 轴的刻度。宽于 0 的条形按 X 轴的刻度比例缩放。
By default, the barWidth is 0.5 (bars will take 50% of the available width). The valid values range from 0.0 (0%) to 1.0 (100%).
注意: When used with the BarSeries type, this value specifies the width of a group of bars instead of that of a single bar.
count
:
int
|
The number of bar sets in a bar series.
labelsAngle : real |
The angle of the value labels in degrees.
labelsFormat : string |
The format used for showing labels in a bar series.
另请参阅 QAbstractBarSeries::labelsFormat , labelsVisible ,和 labelsPosition .
labelsPosition : enumeration |
The position of the data value labels:
常量 | 描述 |
---|---|
AbstractBarSeries.LabelsCenter
|
Label is located in the center of the bar. |
AbstractBarSeries.LabelsInsideEnd
|
Label is located inside the bar at the top. |
AbstractBarSeries.LabelsInsideBase
|
Label is located inside the bar at the bottom. |
AbstractBarSeries.LabelsOutsideEnd
|
Label is located outside the bar at the top. |
另请参阅 labelsVisible and labelsFormat .
labelsPrecision : real |
The maximum amount of significant digits shown in value labels.
默认值为 6。
labelsVisible : bool |
The visibility of the labels in a bar series.
barsetsAdded () |
This signal is emitted when bar sets are added to the series.
The corresponding signal handler is
onBarsetsAdded
.
注意:
相应处理程序是
onBarsetsAdded
.
barsetsRemoved () |
This signal is emitted when bar sets are removed from the series.
The corresponding signal handler is
onBarsetsRemoved
.
注意:
相应处理程序是
onBarsetsRemoved
.
This signal is emitted when the user clicks the bar specified by index in the bar set specified by barset .
The corresponding signal handler is
onClicked
.
注意:
相应处理程序是
onClicked
.
This signal is emitted when the user double-clicks the bar specified by index in the bar set specified by barset .
The corresponding signal handler is
onDoubleClicked
.
注意:
相应处理程序是
onDoubleClicked
.
This signal is emitted when a mouse is hovered over the bar specified by
index
in the bar set specified by
barset
. When the mouse moves over the bar,
status
turns
true
, and when the mouse moves away again, it turns
false
.
The corresponding signal handler is
onHovered
.
注意:
相应处理程序是
onHovered
.
This signal is emitted when the user clicks the bar specified by index in the bar set specified by barset and holds down the mouse button.
The corresponding signal handler is
onPressed
.
注意:
相应处理程序是
onPressed
.
This signal is emitted when the user releases the mouse press on the bar specified by index in the bar set specified by barset .
The corresponding signal handler is
onReleased
.
注意:
相应处理程序是
onReleased
.
Adds a new bar set with label and 值 to the index. 值 is a list of real values.
例如:
myBarSeries.append("set 1", [0, 0.2, 0.2, 0.5, 0.4, 1.5, 0.9]);
Returns the bar set at index . Returns null if the index is not valid.
clear () |
Removes all bar sets from the series.
Adds a new bar set with label and 值 to index . 值 can be a list of real values or a list of XYPoint 类型。
If the index value is equal to or less than zero, the new bar set is prepended to the bar series. If the index value is equal to or greater than the number of bar sets in the bar series, the new bar set is appended to the bar series.
另请参阅 append ().
Removes the bar set specified by
barset
from the series. Returns
true
若成功,
false
否则。