PySide6.QtGraphs.QPieSeries¶
- class QPieSeries¶
- The - QPieSeriesclass presents data in pie graphs.- Details- A pie series consists of slices that are defined as - QPieSliceobjects. The slices can have any values as the- QPieSeriesobject 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 - Added in version 6.8. - Synopsis¶- Properties¶- angleSpanLabelVisibilityᅟ- Mode for label visibility
- angleSpanVisibleLimitᅟ- Angle span limit for label visibility
- countᅟ- Number of slices in the series
- endAngleᅟ- Ending angle of the pie
- holeSizeᅟ- Donut hole size
- horizontalPositionᅟ- Horizontal position of the pie
- pieSizeᅟ- Pie size
- startAngleᅟ- Starting angle of the pie
- sumᅟ- Of all slices
- verticalPositionᅟ- 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 - class LabelVisibility¶
- The mode for label visibility. - Constant - Description - QPieSeries.LabelVisibility.LabelVisibility.None_ - All of the labels of slices with smaller angle span than the - angleSpanVisibleLimitwill be hidden.- QPieSeries.LabelVisibility.LabelVisibility.First - All except the first label of consecutive slices with smaller angle span than the - angleSpanVisibleLimitwill be hidden. This is the default value.- QPieSeries.LabelVisibility.LabelVisibility.Even - Every other label of consecutive slices with smaller angle span than the - angleSpanVisibleLimitwill be hidden, starting from the second one.- QPieSeries.LabelVisibility.LabelVisibility.Odd - Every other label of consecutive slices with smaller angle span than the - angleSpanVisibleLimitwill be hidden, starting from the first one.- See also - Added in version 6.10. 
 - Note - Properties can be used directly when - from __feature__ import true_propertyis used or via accessor functions otherwise.- property angleSpanLabelVisibilityᅟ: QPieSeries.LabelVisibility¶
 - This property holds The mode for label visibility.. - The mode which determines which labels will be hidden if they are under the angle span limit set with - angleSpanVisibleLimit. Has no effect if- angleSpanVisibleLimithas not been set.- See also - Access functions:
 - property angleSpanVisibleLimitᅟ: float¶
 - This property holds The angle span limit for label visibility.. - The angle span that will be used as the visibility limit for a slice label. A slice with angle span under this value will change its visibility based on the - angleSpanLabelVisibilityset to the series. The default value is- 0, which means no slices will be hidden regardless of the- angleSpanLabelVisibility.- See also - Access functions:
 - 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 - pieSizeproperty, 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 - holeSizeproperty 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 - slicesare added to the series.- See also - angleSpanLabelVisibility()¶
- Return type:
 - See also 
 - Getter of property - angleSpanLabelVisibilityᅟ.- angleSpanLabelVisibilityChanged(visibility)¶
- Parameters:
- visibility – - LabelVisibility
 
 - Notification signal of property - angleSpanLabelVisibilityᅟ.- angleSpanVisibleLimit()¶
- Return type:
- float 
 - See also 
 - Getter of property - angleSpanVisibleLimitᅟ.- angleSpanVisibleLimitChanged(limit)¶
- Parameters:
- limit – float 
 
 - Notification signal of property - angleSpanVisibleLimitᅟ.- Appends the slice specified by - sliceto the series. Slice ownership is passed to the series.- Returns - trueif appending succeeds.- append(slices)
- Parameters:
- slices – .list of QPieSlice 
- Return type:
- bool 
 
 - Appends the array of slices specified by - slicesto the series. Slice ownership is passed to the series.- Returns - trueif appending succeeds.- append(label, value)
- Parameters:
- label – str 
- value – float 
 
- Return type:
 
 - Appends a single slice with the specified - valueand- labelto the series. Slice ownership is passed to the series. Returns null if- valueis- NaN,- Inf, or- -Infand 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 - sliceto the series before the slice at the position specified by- index. Slice ownership is passed to the series.- Returns - trueif inserting succeeds.- isEmpty()¶
- Return type:
- bool 
 
 - Returns - trueif the series is empty.- Appends the slice specified by - sliceto 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 - trueif the removal succeeds.- remove(index)
- Parameters:
- index – int 
- Return type:
- bool 
 
 - Removes the PieSlice at the location - index. The PieSlice will be permanently deleted. Returns- trueif removing is successful.- removeMultiple(index, count)¶
- Parameters:
- index – int 
- count – int 
 
 
 - Removes multiple PieSlices from the series starting from - indexto a number of- count. The PieSlices will be permanently deleted.- removed(slices)¶
- Parameters:
- slices – .list of QPieSlice 
 
 - This signal is emitted when the slices specified by - slicesare 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. Returns- trueif all PieSlices are replaced successfully.- Replaces the PieSlice - oldSlicewith- newSliceif found in the series.``oldSlice`` will be permanently deleted. Returns- trueif replacing is successful.- replace(index, slice)
- Parameters:
- index – int 
- slice – - QPieSlice
 
- Return type:
- bool 
 
 - Replaces the PieSlice at position - indexwith the one specified by- slice. The original PieSlice will be permanently deleted. Returns- falseif replacing any of the PieSlices fails.- replaced(slices)¶
- Parameters:
- slices – .list of QPieSlice 
 
 - setAngleSpanLabelVisibility(newAngleSpanVisibleMode)¶
- Parameters:
- newAngleSpanVisibleMode – - LabelVisibility
 - See also 
 - Setter of property - angleSpanLabelVisibilityᅟ.- setAngleSpanVisibleLimit(newAngleSpanVisibleLimit)¶
- Parameters:
- newAngleSpanVisibleLimit – float 
 - See also 
 - Setter of property - angleSpanVisibleLimitᅟ.- 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. - anglemust 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. - anglemust 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 - trueif the take operation was successful.- verticalPosition()¶
- Return type:
- float 
 - See also 
 - Getter of property - verticalPositionᅟ.- verticalPositionChanged()¶
 - Notification signal of property - verticalPositionᅟ.