PySide6.QtGraphs.QPieSeries

class QPieSeries

The QPieSeries class presents data in pie graphs. More

Inheritance diagram of PySide6.QtGraphs.QPieSeries

Added in version 6.8.

Synopsis

Properties

Methods

Signals

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 the QPieSeries 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

QPieSlice

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:
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

verticalPosition

Access functions:
property sizeᅟ: float
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:
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).

Access functions:
__init__([parent=None])
Parameters:

parentQObject

Constructs a series object that is a child of parent.

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ᅟ .

holeSize()
Return type:

float

See also

setHoleSize()

Getter of property holeSizeᅟ .

horizontalPosition()
Return type:

float

Getter of property horizontalPositionᅟ .

isEmpty()
Return type:

bool

Returns true if the series is empty.

pieEndAngle()
Return type:

float

Getter of property endAngleᅟ .

pieSize()
Return type:

float

See also

setPieSize()

Getter of property sizeᅟ .

pieStartAngle()
Return type:

float

Getter of property startAngleᅟ .

setHoleSize(holeSize)
Parameters:

holeSize – float

See also

holeSize()

Setter of property holeSizeᅟ .

setHorizontalPosition(relativePosition)
Parameters:

relativePosition – float

Setter of property horizontalPositionᅟ .

setLabelsVisible([visible=true])
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.

setPieEndAngle(endAngle)
Parameters:

endAngle – float

Setter of property endAngleᅟ .

setPieSize(relativeSize)
Parameters:

relativeSize – float

See also

pieSize()

Setter of property sizeᅟ .

setPieStartAngle(startAngle)
Parameters:

startAngle – float

Setter of property startAngleᅟ .

setVerticalPosition(relativePosition)
Parameters:

relativePosition – float

Setter of property verticalPositionᅟ .

sum()
Return type:

float

Returns the sum of all slice values in this series.

Getter of property sumᅟ .

sumChanged()

Notification signal of property sumᅟ .

verticalPosition()
Return type:

float

Getter of property verticalPositionᅟ .