QPieSlice

The QPieSlice class represents a single slice in a pie series. More

Inheritance diagram of PySide6.QtCharts.QPieSlice

Synopsis

Functions

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

QPieSeries

class PySide6.QtCharts.QPieSlice([parent=None])

PySide6.QtCharts.QPieSlice(label, value[, parent=None])

Parameters

Constructs an empty slice with the parent parent.

See also

append() insert()

Constructs an empty slice with the specified value, label, and parent.

See also

append() insert()

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

PySide6.QtCharts.QPieSlice.angleSpanChanged()
PySide6.QtCharts.QPieSlice.borderColor()
Return type

PySide6.QtGui.QColor

See also

setBorderColor()

PySide6.QtCharts.QPieSlice.borderColorChanged()
PySide6.QtCharts.QPieSlice.borderWidth()
Return type

int

See also

setBorderWidth()

PySide6.QtCharts.QPieSlice.borderWidthChanged()
PySide6.QtCharts.QPieSlice.brush()
Return type

PySide6.QtGui.QBrush

See also

setBrush()

PySide6.QtCharts.QPieSlice.brushChanged()
PySide6.QtCharts.QPieSlice.clicked()
PySide6.QtCharts.QPieSlice.color()
Return type

PySide6.QtGui.QColor

See also

setColor()

PySide6.QtCharts.QPieSlice.colorChanged()
PySide6.QtCharts.QPieSlice.doubleClicked()
PySide6.QtCharts.QPieSlice.explodeDistanceFactor()
Return type

float

PySide6.QtCharts.QPieSlice.hovered(state)
Parameters

state – bool

PySide6.QtCharts.QPieSlice.isExploded()
Return type

bool

PySide6.QtCharts.QPieSlice.isLabelVisible()
Return type

bool

PySide6.QtCharts.QPieSlice.label()
Return type

str

See also

setLabel()

PySide6.QtCharts.QPieSlice.labelArmLengthFactor()
Return type

float

PySide6.QtCharts.QPieSlice.labelBrush()
Return type

PySide6.QtGui.QBrush

See also

setLabelBrush()

PySide6.QtCharts.QPieSlice.labelBrushChanged()
PySide6.QtCharts.QPieSlice.labelChanged()
PySide6.QtCharts.QPieSlice.labelColor()
Return type

PySide6.QtGui.QColor

See also

setLabelColor()

PySide6.QtCharts.QPieSlice.labelColorChanged()
PySide6.QtCharts.QPieSlice.labelFont()
Return type

PySide6.QtGui.QFont

See also

setLabelFont()

PySide6.QtCharts.QPieSlice.labelFontChanged()
PySide6.QtCharts.QPieSlice.labelPosition()
Return type

LabelPosition

PySide6.QtCharts.QPieSlice.labelVisibleChanged()
PySide6.QtCharts.QPieSlice.pen()
Return type

PySide6.QtGui.QPen

See also

setPen()

PySide6.QtCharts.QPieSlice.penChanged()
PySide6.QtCharts.QPieSlice.percentage()
Return type

float

PySide6.QtCharts.QPieSlice.percentageChanged()
PySide6.QtCharts.QPieSlice.pressed()
PySide6.QtCharts.QPieSlice.released()
PySide6.QtCharts.QPieSlice.series()
Return type

PySide6.QtCharts.QPieSeries

Returns the series that this slice belongs to.

See also

append()

PySide6.QtCharts.QPieSlice.setBorderColor(color)
Parameters

colorPySide6.QtGui.QColor

See also

borderColor()

PySide6.QtCharts.QPieSlice.setBorderWidth(width)
Parameters

width – int

See also

borderWidth()

PySide6.QtCharts.QPieSlice.setBrush(brush)
Parameters

brushPySide6.QtGui.QBrush

See also

brush()

PySide6.QtCharts.QPieSlice.setColor(color)
Parameters

colorPySide6.QtGui.QColor

See also

color()

PySide6.QtCharts.QPieSlice.setExplodeDistanceFactor(factor)
Parameters

factor – float

PySide6.QtCharts.QPieSlice.setExploded([exploded=true])
Parameters

exploded – bool

See also

isExploded()

PySide6.QtCharts.QPieSlice.setLabel(label)
Parameters

label – str

See also

label()

PySide6.QtCharts.QPieSlice.setLabelArmLengthFactor(factor)
Parameters

factor – float

PySide6.QtCharts.QPieSlice.setLabelBrush(brush)
Parameters

brushPySide6.QtGui.QBrush

See also

labelBrush()

PySide6.QtCharts.QPieSlice.setLabelColor(color)
Parameters

colorPySide6.QtGui.QColor

See also

labelColor()

PySide6.QtCharts.QPieSlice.setLabelFont(font)
Parameters

fontPySide6.QtGui.QFont

See also

labelFont()

PySide6.QtCharts.QPieSlice.setLabelPosition(position)
Parameters

positionLabelPosition

See also

labelPosition()

PySide6.QtCharts.QPieSlice.setLabelVisible([visible=true])
Parameters

visible – bool

See also

isLabelVisible()

PySide6.QtCharts.QPieSlice.setPen(pen)
Parameters

penPySide6.QtGui.QPen

See also

pen()

PySide6.QtCharts.QPieSlice.setValue(value)
Parameters

value – float

See also

value()

PySide6.QtCharts.QPieSlice.startAngle()
Return type

float

PySide6.QtCharts.QPieSlice.startAngleChanged()
PySide6.QtCharts.QPieSlice.value()
Return type

float

See also

setValue()

PySide6.QtCharts.QPieSlice.valueChanged()