Class: QgsPieChartPlot

A simple pie chart class.

Warning

This class is not considered stable API, and may change in future!

Added in version 4.0.

Class Hierarchy

Inheritance diagram of qgis.core.QgsPieChartPlot

Base classes

Qgs2DPlot

Base class for 2-dimensional plot/chart/graphs.

QgsPlot

Base class for plot/chart/graphs.

Methods

colorRampAt

Returns the color ramp for the series with matching index.

colorRampCount

Returns the color ramps list count.

fillSymbolAt

Returns the fill symbol for the series with matching index.

fillSymbolCount

Returns the fill symbols list count.

labelType

Returns the pie chart label type.

numericFormat

Returns the numeric format used for the pie chart labels.

setColorRampAt

Sets the color ramp for the series with matching index.

setFillSymbolAt

Sets the fill symbol to use for the series with matching index.

setLabelType

Sets the pie chart label type.

setNumericFormat

Sets the numeric format used for the pie chart labels.

setTextFormat

Sets the text format used for the pie chart labels.

textFormat

Returns the text format used for the pie chart labels.

Static Methods

create

Returns a new pie chart.

createDataGatherer

Returns a new data gatherer for a given pie chart plot.

class qgis.core.QgsPieChartPlot[source]

Bases: Qgs2DPlot

colorRampAt(self, index: int) QgsColorRamp | None[source]

Returns the color ramp for the series with matching index.

Parameters:

index (int)

Return type:

Optional[QgsColorRamp]

colorRampCount(self) int[source]

Returns the color ramps list count.

Return type:

int

static create() QgsPieChartPlot | None[source]

Returns a new pie chart.

Return type:

Optional[QgsPieChartPlot]

static createDataGatherer(plot: QgsPlot | None) QgsVectorLayerAbstractPlotDataGatherer | None[source]

Returns a new data gatherer for a given pie chart plot.

Parameters:

plot (Optional[QgsPlot])

Return type:

Optional[QgsVectorLayerAbstractPlotDataGatherer]

fillSymbolAt(self, index: int) QgsFillSymbol | None[source]

Returns the fill symbol for the series with matching index.

Parameters:

index (int)

Return type:

Optional[QgsFillSymbol]

fillSymbolCount(self) int[source]

Returns the fill symbols list count.

Return type:

int

labelType(self) Qgis.PieChartLabelType[source]

Returns the pie chart label type.

Return type:

Qgis.PieChartLabelType

numericFormat(self) QgsNumericFormat | None[source]

Returns the numeric format used for the pie chart labels.

Return type:

Optional[QgsNumericFormat]

setColorRampAt(self, index: int, ramp: QgsColorRamp | None)[source]

Sets the color ramp for the series with matching index.

Parameters:
setFillSymbolAt(self, index: int, symbol: QgsFillSymbol | None)[source]

Sets the fill symbol to use for the series with matching index.

Parameters:
setLabelType(self, type: Qgis.PieChartLabelType)[source]

Sets the pie chart label type.

Parameters:

type (Qgis.PieChartLabelType)

setNumericFormat(self, format: QgsNumericFormat | None)[source]

Sets the numeric format used for the pie chart labels.

Ownership of format is transferred to the plot.

See also

numericFormat()

Parameters:

format (Optional[QgsNumericFormat])

setTextFormat(self, format: QgsTextFormat)[source]

Sets the text format used for the pie chart labels.

See also

textFormat()

Parameters:

format (QgsTextFormat)

textFormat(self) QgsTextFormat[source]

Returns the text format used for the pie chart labels.

See also

setTextFormat()

Return type:

QgsTextFormat