Class: QgsPlot¶
Base class for plot/chart/graphs.
Warning
This class is not considered stable API, and may change in future!
Added in version 3.26.
Class Hierarchy¶
Subclasses¶
Base class for 2-dimensional plot/chart/graphs. |
Enums
Data defined properties for different plot types |
|
alias of |
Methods
Returns a reference to the plot's property collection, used for data defined overrides. |
|
Returns the plot property definitions. |
|
Sets the plot's property collection, used for data defined overrides. |
|
Sets a data defined property for the plot. |
Virtual Methods
In PyQGIS, only methods marked as virtual
can be safely overridden in a Python subclass of QgsPlot. See the FAQ for more details.
Reads the plot's properties from an XML element. |
|
Returns the plot's type. |
|
Writes the plot's properties into an XML element. |
- class qgis.core.QgsPlot[source]¶
Bases:
object
- class DataDefinedProperty(*values)¶
Bases:
IntEnum
Data defined properties for different plot types
Added in version 4.0.
MarginLeft
: Left marginMarginTop
: Top marginMarginRight
: Right marginMarginBottom
: Bottom marginXAxisMajorInterval
: Major grid line interval for X axisXAxisMinorInterval
: Minor grid line interval for X axisXAxisLabelInterval
: Label interval for X axisYAxisMajorInterval
: Major grid line interval for Y axisYAxisMinorInterval
: Minor grid line interval for Y axisYAxisLabelInterval
: Label interval for Y axisXAxisMinimum
: Minimum X axis valueXAxisMaximum
: Maximum X axis valueYAxisMinimum
: Minimum Y axis valueYAxisMaximum
: Maximum Y axis value
- Property¶
alias of
DataDefinedProperty
- dataDefinedProperties(self) QgsPropertyCollection ¶
Returns a reference to the plot’s property collection, used for data defined overrides.
See also
Added in version 4.0.
- Return type:
- propertyDefinitions() Dict[int, QgsPropertyDefinition] ¶
Returns the plot property definitions.
- Return type:
Dict[int, QgsPropertyDefinition]
- virtual readXml(self, element: QDomElement, context: QgsReadWriteContext) bool [source]¶
Reads the plot’s properties from an XML
element
.- Parameters:
element (QDomElement)
context (QgsReadWriteContext)
- Return type:
bool
- setDataDefinedProperties(self, collection: QgsPropertyCollection)[source]¶
Sets the plot’s property collection, used for data defined overrides.
- Parameters:
collection (QgsPropertyCollection) – property collection. Existing properties will be replaced.
See also
Added in version 4.0.
- setDataDefinedProperty(self, key: QgsPlot.DataDefinedProperty, property: QgsProperty)[source]¶
Sets a data defined property for the plot. Any existing property with the same key will be overwritten.
See also
Added in version 4.0.
- Parameters:
property (QgsProperty)
- virtual writeXml(self, element: QDomElement, document: QDomDocument, context: QgsReadWriteContext) bool [source]¶
Writes the plot’s properties into an XML
element
.- Parameters:
element (QDomElement)
document (QDomDocument)
context (QgsReadWriteContext)
- Return type:
bool