QPieSlice¶
The QPieSlice
class represents a single slice in a pie series. More…
Synopsis¶
Functions¶
def
angleSpan
()def
borderColor
()def
borderWidth
()def
brush
()def
color
()def
explodeDistanceFactor
()def
isExploded
()def
isLabelVisible
()def
label
()def
labelArmLengthFactor
()def
labelBrush
()def
labelColor
()def
labelFont
()def
labelPosition
()def
pen
()def
percentage
()def
series
()def
setBorderColor
(color)def
setBorderWidth
(width)def
setBrush
(brush)def
setColor
(color)def
setExplodeDistanceFactor
(factor)def
setExploded
([exploded=true])def
setLabel
(label)def
setLabelArmLengthFactor
(factor)def
setLabelBrush
(brush)def
setLabelColor
(color)def
setLabelFont
(font)def
setLabelPosition
(position)def
setLabelVisible
([visible=true])def
setPen
(pen)def
setValue
(value)def
startAngle
()def
value
()
Signals¶
def
angleSpanChanged
()def
borderColorChanged
()def
borderWidthChanged
()def
brushChanged
()def
clicked
()def
colorChanged
()def
doubleClicked
()def
hovered
(state)def
labelBrushChanged
()def
labelChanged
()def
labelColorChanged
()def
labelFontChanged
()def
labelVisibleChanged
()def
penChanged
()def
percentageChanged
()def
pressed
()def
released
()def
startAngleChanged
()def
valueChanged
()
Detailed Description¶
A pie slice has a value and a label. When the slice is added to a pie series, the QPieSeries
object 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 chart.
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.
To enable user interaction with the pie chart, some basic signals are emitted when users click pie slices or hover the mouse over them.
See also
- class PySide6.QtCharts.QPieSlice([parent=None])¶
PySide6.QtCharts.QPieSlice(label, value[, parent=None])
- Parameters
value – float
label – str
parent –
PySide6.QtCore.QObject
Constructs an empty slice with the parent parent
.
Constructs an empty slice with the specified value
, label
, and parent
.
- PySide6.QtCharts.QPieSlice.LabelPosition¶
This enum describes the position of the slice label.
Constant
Description
QPieSlice.LabelOutside
The label is located outside the slice connected to it with an arm. This is the default value.
QPieSlice.LabelInsideHorizontal
The label is centered within the slice and laid out horizontally.
QPieSlice.LabelInsideTangential
The label is centered within the slice and rotated to be parallel with the tangential of the slice’s arc.
QPieSlice.LabelInsideNormal
The label is centered within the slice and rotated to be parallel with the normal of the slice’s arc.
- PySide6.QtCharts.QPieSlice.angleSpan()¶
- Return type
float
This property holds 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..
- PySide6.QtCharts.QPieSlice.angleSpanChanged()¶
- PySide6.QtCharts.QPieSlice.borderColor()¶
- Return type
This property holds The color used to draw the slice border. This is a convenience property for modifying the slice pen..
See also
- PySide6.QtCharts.QPieSlice.borderColorChanged()¶
- PySide6.QtCharts.QPieSlice.borderWidth()¶
- Return type
int
This property holds The width of the slice border. This is a convenience property for modifying the slice pen..
See also
- PySide6.QtCharts.QPieSlice.borderWidthChanged()¶
- PySide6.QtCharts.QPieSlice.brush()¶
- Return type
This property holds The brush used to fill the slice..
- PySide6.QtCharts.QPieSlice.brushChanged()¶
- PySide6.QtCharts.QPieSlice.clicked()¶
- PySide6.QtCharts.QPieSlice.color()¶
- Return type
This property holds The fill (brush) color of the slice. This is a convenience property for modifying the slice brush..
See also
- PySide6.QtCharts.QPieSlice.colorChanged()¶
- PySide6.QtCharts.QPieSlice.doubleClicked()¶
- PySide6.QtCharts.QPieSlice.explodeDistanceFactor()¶
- Return type
float
This property Determines how far away from the pie the slice is exploded..
1.0 means that the distance is the same as the radius.
0.5 means that the distance is half of the radius.
By default, the distance is 0.15
See also
exploded
- PySide6.QtCharts.QPieSlice.hovered(state)¶
- Parameters
state – bool
- PySide6.QtCharts.QPieSlice.isExploded()¶
- Return type
bool
This property holds Whether the slice is separated from the pie..
See also
- PySide6.QtCharts.QPieSlice.isLabelVisible()¶
- Return type
bool
This property holds The visibility of the slice label. By default, the label is not visible..
See also
- PySide6.QtCharts.QPieSlice.label()¶
- Return type
str
This property holds The label of the slice..
See also
labelVisible
labelBrush
labelFont
labelArmLengthFactor
- PySide6.QtCharts.QPieSlice.labelArmLengthFactor()¶
- Return type
float
This property holds The length of the label arm. The factor is relative to the pie radius. For example:.
1.0 means that the length is the same as the radius.
0.5 means that the length is half of the radius.
By default, the arm length is 0.15
See also
label
labelVisible
labelBrush
labelFont
- PySide6.QtCharts.QPieSlice.labelBrush()¶
- Return type
This property holds The brush used to draw the label and label arm of the slice..
See also
label
labelVisible
labelFont
labelArmLengthFactor
- PySide6.QtCharts.QPieSlice.labelBrushChanged()¶
- PySide6.QtCharts.QPieSlice.labelChanged()¶
- PySide6.QtCharts.QPieSlice.labelColor()¶
- Return type
This property holds The color used to draw the slice label. This is a convenience property for modifying the slice label brush..
See also
- PySide6.QtCharts.QPieSlice.labelColorChanged()¶
- PySide6.QtCharts.QPieSlice.labelFont()¶
- Return type
This property holds The font used for drawing the label text..
See also
label
labelVisible
labelArmLengthFactor
- PySide6.QtCharts.QPieSlice.labelFontChanged()¶
- PySide6.QtCharts.QPieSlice.labelPosition()¶
- Return type
This property holds The position of the slice label..
See also
label
labelVisible
- PySide6.QtCharts.QPieSlice.labelVisibleChanged()¶
- PySide6.QtCharts.QPieSlice.pen()¶
- Return type
This property holds The pen used to draw the slice border..
- PySide6.QtCharts.QPieSlice.penChanged()¶
- PySide6.QtCharts.QPieSlice.percentage()¶
- Return type
float
This property holds 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..
- PySide6.QtCharts.QPieSlice.percentageChanged()¶
- PySide6.QtCharts.QPieSlice.pressed()¶
- PySide6.QtCharts.QPieSlice.released()¶
- PySide6.QtCharts.QPieSlice.series()¶
- Return type
Returns the series that this slice belongs to.
See also
- PySide6.QtCharts.QPieSlice.setBorderColor(color)¶
- Parameters
color –
PySide6.QtGui.QColor
This property holds The color used to draw the slice border. This is a convenience property for modifying the slice pen..
See also
- PySide6.QtCharts.QPieSlice.setBorderWidth(width)¶
- Parameters
width – int
This property holds The width of the slice border. This is a convenience property for modifying the slice pen..
See also
- PySide6.QtCharts.QPieSlice.setBrush(brush)¶
- Parameters
brush –
PySide6.QtGui.QBrush
This property holds The brush used to fill the slice..
- PySide6.QtCharts.QPieSlice.setColor(color)¶
- Parameters
color –
PySide6.QtGui.QColor
This property holds The fill (brush) color of the slice. This is a convenience property for modifying the slice brush..
See also
- PySide6.QtCharts.QPieSlice.setExplodeDistanceFactor(factor)¶
- Parameters
factor – float
This property Determines how far away from the pie the slice is exploded..
1.0 means that the distance is the same as the radius.
0.5 means that the distance is half of the radius.
By default, the distance is 0.15
See also
exploded
- PySide6.QtCharts.QPieSlice.setExploded([exploded=true])¶
- Parameters
exploded – bool
This property holds Whether the slice is separated from the pie..
See also
- PySide6.QtCharts.QPieSlice.setLabel(label)¶
- Parameters
label – str
This property holds The label of the slice..
See also
labelVisible
labelBrush
labelFont
labelArmLengthFactor
- PySide6.QtCharts.QPieSlice.setLabelArmLengthFactor(factor)¶
- Parameters
factor – float
This property holds The length of the label arm. The factor is relative to the pie radius. For example:.
1.0 means that the length is the same as the radius.
0.5 means that the length is half of the radius.
By default, the arm length is 0.15
See also
label
labelVisible
labelBrush
labelFont
- PySide6.QtCharts.QPieSlice.setLabelBrush(brush)¶
- Parameters
brush –
PySide6.QtGui.QBrush
This property holds The brush used to draw the label and label arm of the slice..
See also
label
labelVisible
labelFont
labelArmLengthFactor
- PySide6.QtCharts.QPieSlice.setLabelColor(color)¶
- Parameters
color –
PySide6.QtGui.QColor
This property holds The color used to draw the slice label. This is a convenience property for modifying the slice label brush..
See also
- PySide6.QtCharts.QPieSlice.setLabelFont(font)¶
- Parameters
font –
PySide6.QtGui.QFont
This property holds The font used for drawing the label text..
See also
label
labelVisible
labelArmLengthFactor
- PySide6.QtCharts.QPieSlice.setLabelPosition(position)¶
- Parameters
position –
LabelPosition
This property holds The position of the slice label..
See also
label
labelVisible
- PySide6.QtCharts.QPieSlice.setLabelVisible([visible=true])¶
- Parameters
visible – bool
This property holds The visibility of the slice label. By default, the label is not visible..
See also
- PySide6.QtCharts.QPieSlice.setPen(pen)¶
- Parameters
pen –
PySide6.QtGui.QPen
This property holds The pen used to draw the slice border..
- PySide6.QtCharts.QPieSlice.setValue(value)¶
- Parameters
value – float
This property holds The value of the slice..
- PySide6.QtCharts.QPieSlice.startAngle()¶
- Return type
float
This property holds 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..
- PySide6.QtCharts.QPieSlice.startAngleChanged()¶
- PySide6.QtCharts.QPieSlice.value()¶
- Return type
float
This property holds The value of the slice..
- PySide6.QtCharts.QPieSlice.valueChanged()¶
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.