Class: QgsPlotData

Encapsulates one or more plot series.

Warning

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

Added in version 4.0.

Methods

addSeries

Adds a series to the plot data.

categories

Returns the name of the series' categories.

clearSeries

Clears all series from the plot data.

series

Returns the list of series forming the plot data.

setCategories

Sets the name of the series' categories.

class qgis.core.QgsPlotData[source]

Bases: object

addSeries(self, series: QgsAbstractPlotSeries | None)[source]

Adds a series to the plot data.

Note

the series’ ownership is transferred to this object.

Parameters:

series (Optional[QgsAbstractPlotSeries])

categories(self) List[str][source]

Returns the name of the series’ categories.

Return type:

List[str]

clearSeries(self)[source]

Clears all series from the plot data.

series(self) List[QgsAbstractPlotSeries]

Returns the list of series forming the plot data.

Note

the series’ ownership is retained by this object.

Return type:

List[QgsAbstractPlotSeries]

setCategories(self, categories: Iterable[str | None])[source]

Sets the name of the series’ categories.

Parameters:

categories (Iterable[Optional[str]])