PySide6.QtGraphs.QPieSeries¶
- class QPieSeries¶
The
QPieSeries
class presents data in pie graphs. More…Added in version 6.8.
Synopsis¶
Properties¶
countᅟ
- Number of slices in the seriesendAngleᅟ
- Ending angle of the pieholeSizeᅟ
- Donut hole sizehorizontalPositionᅟ
- Horizontal position of the piepieSizeᅟ
- Pie sizestartAngleᅟ
- Starting angle of the piesumᅟ
- Of all slicesverticalPositionᅟ
- Vertical position of the pie
Methods¶
def
__init__()
def
append()
def
at()
def
clear()
def
count()
def
endAngle()
def
find()
def
holeSize()
def
insert()
def
isEmpty()
def
__lshift__()
def
pieSize()
def
remove()
def
removeMultiple()
def
replace()
def
setEndAngle()
def
setHoleSize()
def
setPieSize()
def
setStartAngle()
def
slices()
def
startAngle()
def
sum()
def
take()
Slots¶
Signals¶
def
added()
def
clicked()
def
countChanged()
def
doubleClicked()
def
pieSizeChanged()
def
pressed()
def
released()
def
removed()
def
replaced()
def
sumChanged()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description¶
A pie series consists of slices that are defined as
QPieSlice
objects. The slices can have any values as theQPieSeries
object calculates the percentage of a slice compared with the sum of all slices in the series to determine the actual size of the slice in the graph.Pie size and position on the graph are controlled by using relative values that range from 0.0 to 1.0. These relate to the actual graph rectangle.
By default, the pie is defined as a full pie. A partial pie can be created by setting a starting angle and angle span for the series. A full pie is 360 degrees, where 0 is at 12 a’clock.
See also
Note
Properties can be used directly when
from __feature__ import true_property
is used or via accessor functions otherwise.- property countᅟ: int¶
This property holds The number of slices in the series..
- Access functions:
Signal
countChanged()
- property endAngleᅟ: float¶
This property holds The ending angle of the pie..
A full pie is 360 degrees, where 0 degrees is at 12 o’clock.
The default value is 360.
- Access functions:
- property holeSizeᅟ: float¶
This property holds The donut hole size..
When setting the
pieSize
property, this property is adjusted if necessary, to ensure that the hole size is not greater than the pie size.The default value is 0.0.
- Access functions:
- property horizontalPositionᅟ: float¶
This property holds The horizontal position of the pie..
The value is relative to the graph rectangle, so that:
0.0 is the absolute left.
1.0 is the absolute right.
The default value is 0.5 (center).
See also
- Access functions:
- property pieSizeᅟ: float¶
This property holds The pie size..
The value is relative to the graph rectangle, so that:
0.0 is the minimum pieSize (pie not drawn).
1.0 is the maximum pieSize that can fit the graph.
When setting this property, the
holeSize
property is adjusted if necessary, to ensure that the hole size is not greater than the pie size.The default value is 0.7.
- Access functions:
- property startAngleᅟ: float¶
This property holds The starting angle of the pie..
A full pie is 360 degrees, where 0 degrees is at 12 o’clock.
The default value is 0.
- Access functions:
- property sumᅟ: float¶
This property holds The sum of all slices..
The series keeps track of the sum of all the slices it holds.
- Access functions:
Signal
sumChanged()
- property verticalPositionᅟ: float¶
This property holds The vertical position of the pie..
The value is relative to the graph rectangle, so that:
0.0 is the absolute top.
1.0 is the absolute bottom.
The default value is 0.5 (center).
See also
- Access functions:
Constructs a series object that is a child of
parent
.- added(slices)¶
- Parameters:
slices – .list of QPieSlice
This signal is emitted when the slices specified by
slices
are added to the series.See also
Appends the slice specified by
slice
to the series. Slice ownership is passed to the series.Returns
true
if appending succeeds.- append(slices)
- Parameters:
slices – .list of QPieSlice
- Return type:
bool
Appends the array of slices specified by
slices
to the series. Slice ownership is passed to the series.Returns
true
if appending succeeds.- append(label, value)
- Parameters:
label – str
value – float
- Return type:
Appends a single slice with the specified
value
andlabel
to the series. Slice ownership is passed to the series. Returns null ifvalue
isNaN
,Inf
, or-Inf
and adds nothing to the series.Returns the PieSlice at the position
index
. Returns null if no PieSlice was found.- clear()¶
Clears all slices from the series.
- count()¶
- Return type:
int
Returns the number of the slices in this series.
Getter of property
countᅟ
.- countChanged()¶
Notification signal of property
countᅟ
.- endAngle()¶
- Return type:
float
Returns the end angle of the pie.
A full pie is 360 degrees, where 0 degrees is at 12 o’clock.
See also
Getter of property
endAngleᅟ
.- endAngleChanged()¶
Notification signal of property
endAngleᅟ
.Searches for a PieSlice which contains the label
label
. Returns the PieSlice if found, null otherwise.- handleSliceChange()¶
- holeSize()¶
- Return type:
float
See also
Getter of property
holeSizeᅟ
.- holeSizeChanged()¶
Notification signal of property
holeSizeᅟ
.- horizontalPosition()¶
- Return type:
float
See also
Getter of property
horizontalPositionᅟ
.- horizontalPositionChanged()¶
Notification signal of property
horizontalPositionᅟ
.Inserts the slice specified by
slice
to the series before the slice at the position specified byindex
. Slice ownership is passed to the series.Returns
true
if inserting succeeds.- isEmpty()¶
- Return type:
bool
Returns
true
if the series is empty.Appends the slice specified by
slice
to the series and returns a reference to the series. Slice ownership is passed to the series.- pieSize()¶
- Return type:
float
See also
Getter of property
pieSizeᅟ
.- pieSizeChanged()¶
Notification signal of property
pieSizeᅟ
.Removes a single slice, specified by
slice
, from the series and deletes it permanently.The pointer cannot be referenced after this call.
Returns
true
if the removal succeeds.- remove(index)
- Parameters:
index – int
- Return type:
bool
Removes the PieSlice at the location
index
. The PieSlice will be permanently deleted. Returnstrue
if removing is successful.- removeMultiple(index, count)¶
- Parameters:
index – int
count – int
Removes multiple PieSlices from the series starting from
index
to a number ofcount
. The PieSlices will be permanently deleted.- removed(slices)¶
- Parameters:
slices – .list of QPieSlice
This signal is emitted when the slices specified by
slices
are removed from the series.See also
- replace(slices)¶
- Parameters:
slices – .list of QPieSlice
- Return type:
bool
Replaces the entire list of PieSlices in the series with the list specified by
slices
. All the original PieSlices will be permanently deleted. Returnstrue
if all PieSlices are replaced successfully.Replaces the PieSlice
oldSlice
withnewSlice
if found in the series.``oldSlice`` will be permanently deleted. Returnstrue
if replacing is successful.- replace(index, slice)
- Parameters:
index – int
slice –
QPieSlice
- Return type:
bool
Replaces the PieSlice at position
index
with the one specified byslice
. The original PieSlice will be permanently deleted. Returnsfalse
if replacing any of the PieSlices fails.- replaced(slices)¶
- Parameters:
slices – .list of QPieSlice
- setEndAngle(endAngle)¶
- Parameters:
endAngle – float
Sets the end angle of the pie.
A full pie is 360 degrees, where 0 degrees is at 12 o’clock.
angle
must be greater than the start angle.See also
Setter of property
endAngleᅟ
.- setHoleSize(holeSize)¶
- Parameters:
holeSize – float
See also
Setter of property
holeSizeᅟ
.- setHorizontalPosition(relativePosition)¶
- Parameters:
relativePosition – float
See also
Setter of property
horizontalPositionᅟ
.- setLabelsPosition(position)¶
- Parameters:
position –
LabelPosition
Sets the position of all the slice labels to
position
.Note
This function affects only the current slices in the series. If a new slice is added, the default label position is QPieSlice::LabelOutside.
See also
- setLabelsVisible(visible)¶
- Parameters:
visible – bool
Sets the visibility of all slice labels to
visible
.Note
This function affects only the current slices in the series. If a new slice is added, the default label visibility is
false
.See also
Setter of property
pieSizeᅟ
.- setStartAngle(startAngle)¶
- Parameters:
startAngle – float
Sets the start angle of the pie.
A full pie is 360 degrees, where 0 degrees is at 12 o’clock.
angle
must be smaller than the end angle.See also
Setter of property
startAngleᅟ
.- setVerticalPosition(relativePosition)¶
- Parameters:
relativePosition – float
See also
Setter of property
verticalPositionᅟ
.Returns a list of slices that belong to this series.
- startAngle()¶
- Return type:
float
Returns the start angle of the pie.
A full pie is 360 degrees, where 0 degrees is at 12 o’clock.
See also
Getter of property
startAngleᅟ
.- startAngleChanged()¶
Notification signal of property
startAngleᅟ
.- sum()¶
- Return type:
float
Returns the sum of all slice values in this series.
See also
Getter of property
sumᅟ
.- sumChanged()¶
Notification signal of property
sumᅟ
.Takes a single slice, specified by
slice
, from the series. Does not delete the slice object.Note
The series remains the slice’s parent object. You must set the parent object to take full ownership.
Returns
true
if the take operation was successful.- verticalPosition()¶
- Return type:
float
See also
Getter of property
verticalPositionᅟ
.- verticalPositionChanged()¶
Notification signal of property
verticalPositionᅟ
.