Represents a single slice in a pie series. 更多...
| import 语句: |
import QtGraphs
|
| 在 C++: | QPieSlice |
A pie slice has a value and a label. When the slice is added to a pie series, the PieSeries type calculates the percentage of the slice compared with the sum of all slices in the series to determine the actual size of the slice in the graph.
By default, the label is hidden. If it is visible, it can be either located outside the slice and connected to it with an arm or centered inside the slice either horizontally or in parallel with the tangential or normal of the slice's arc.
By default, the visual appearance of the slice is set by a theme, but the theme can be overridden by specifying slice properties. However, if the theme is changed after the slices are customized, all customization will be lost.
The PieSlice type should be used as a child of a PieSeries type. For example:
PieSeries { PieSlice { label: "example" value: 1 } }
Alternatively, slices can be added to a pie series by using the PieSeries.append () 方法。
In that case, PieSeries.at () 或 PieSeries.find () can be used to access the properties of an individual PieSlice instance.
另请参阅 PieSeries .
|
angleSpan
:
real
|
The span of the slice in degrees. A full pie is 360 degrees, where 0 degrees is at 12 a'clock. Updated automatically once the slice is added to the series.
|
borderColor : color |
The color used to draw the slice border.
另请参阅 borderWidth .
|
borderWidth : real |
The width of the slice border. This is a convenience property for modifying the slice border width.
另请参阅 borderColor .
|
color : color |
The fill color of the slice.
|
explodeDistanceFactor : real |
Determines how far away from the pie the slice is exploded.
By default, the distance is 0.15
另请参阅 exploded .
|
exploded : bool |
Whether the slice is separated from the pie.
另请参阅 explodeDistanceFactor .
|
label : string |
The label of the slice.
注意: The string can be HTML formatted.
|
labelArmLengthFactor : real |
The length of the label arm. The factor is relative to the pie radius. For example:
By default, the arm length is 0.15
另请参阅 labelVisible .
|
labelColor : color |
The color used to draw the slice label.
|
labelFont : font |
The font used for the slice label.
更多信息,见 font .
另请参阅 labelVisible and labelPosition .
|
labelPosition : enumeration |
Describes the position of the slice label.
| 常量 | 描述 |
|---|---|
PieSlice.LabelPosition.Outside
|
The label is located outside the slice connected to it with an arm. This is the default value. |
PieSlice.LabelPosition.InsideHorizontal
|
The label is centered within the slice and laid out horizontally. |
PieSlice.LabelPosition.InsideTangential
|
The label is centered within the slice and rotated to be parallel with the tangential of the slice's arc. |
PieSlice.LabelPosition.InsideNormal
|
The label is centered within the slice and rotated to be parallel with the normal of the slice's arc. |
另请参阅 labelVisible .
|
labelVisible : bool |
The visibility of the slice label. By default, the label is not visible.
|
percentage
:
real
|
The percentage of the slice compared to the sum of all slices in the series. The actual value ranges from 0.0 to 1.0. Updated automatically once the slice is added to the series.
|
startAngle
:
real
|
The starting angle of this slice in the series it belongs to. A full pie is 360 degrees, where 0 degrees is at 12 a'clock. Updated automatically once the slice is added to the series.
|
value : real |
The value of the slice.
注意: A negative value is converted to a positive value.
|
angleSpanChanged () |
This signal is emitted when the angle span of the slice changes.
注意:
相应处理程序是
onAngleSpanChanged
.
另请参阅 angleSpan .
|
borderColorChanged () |
This signal is emitted when the slice border color changes.
注意:
相应处理程序是
onBorderColorChanged
.
另请参阅 borderColor .
|
borderWidthChanged () |
This signal is emitted when the slice border width changes.
注意:
相应处理程序是
onBorderWidthChanged
.
另请参阅 borderWidth .
|
colorChanged () |
This signal is emitted when the slice color changes.
注意:
相应处理程序是
onColorChanged
.
|
explodeDistanceFactorChanged () |
This signal is emitted when the explode distance factor changes.
注意:
相应处理程序是
onExplodeDistanceFactorChanged
.
另请参阅 explodeDistanceFactor .
|
explodedChanged () |
This signal is emitted when the exploded property changes.
注意:
相应处理程序是
onExplodedChanged
.
另请参阅 exploded .
|
labelArmLengthFactorChanged () |
This signal is emitted when the label arm length factor changes.
注意:
相应处理程序是
onLabelArmLengthFactorChanged
.
另请参阅 labelArmLengthFactor .
|
labelChanged () |
This signal is emitted when the slice label changes.
注意:
相应处理程序是
onLabelChanged
.
另请参阅 label .
|
labelColorChanged () |
This signal is emitted when the slice label color changes.
注意:
相应处理程序是
onLabelColorChanged
.
另请参阅 labelColor .
|
labelFontChanged () |
This signal is emitted when the label font of the slice changes.
注意:
相应处理程序是
onLabelFontChanged
.
另请参阅 labelFont .
|
labelFontChanged () |
This signal is emitted when the label font changes.
注意:
相应处理程序是
onLabelFontChanged
.
另请参阅 labelFont .
|
labelPositionChanged () |
This signal is emitted when the label position changes.
注意:
相应处理程序是
onLabelPositionChanged
.
另请参阅 labelPosition .
|
labelVisibleChanged () |
This signal is emitted when the visibility of the slice label changes.
注意:
相应处理程序是
onLabelVisibleChanged
.
另请参阅 labelVisible .
|
percentageChanged () |
This signal is emitted when the percentage of the slice changes.
注意:
相应处理程序是
onPercentageChanged
.
另请参阅 percentage .
|
startAngleChanged () |
This signal is emitted when the starting angle of the slice changes.
注意:
相应处理程序是
onStartAngleChanged
.
另请参阅 startAngle .
|
valueChanged () |
This signal is emitted when the slice value changes.
注意:
相应处理程序是
onValueChanged
.
另请参阅 value .