QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
QgsPlot Class Reference

Base class for plot/chart/graphs. More...

#include <qgsplot.h>

Inheritance diagram for QgsPlot:

Public Types

enum class  DataDefinedProperty : int {
  MarginLeft , MarginTop , MarginRight , MarginBottom ,
  XAxisMajorInterval , XAxisMinorInterval , XAxisLabelInterval , YAxisMajorInterval ,
  YAxisMinorInterval , YAxisLabelInterval , XAxisMinimum , XAxisMaximum ,
  YAxisMinimum , YAxisMaximum
}
 Data defined properties for different plot types. More...

Public Member Functions

 QgsPlot ()=default
virtual ~QgsPlot ()
QgsPropertyCollectiondataDefinedProperties ()
 Returns a reference to the plot's property collection, used for data defined overrides.
const QgsPropertyCollectiondataDefinedProperties () const
 Returns a reference to the plot's property collection, used for data defined overrides.
virtual bool readXml (const QDomElement &element, const QgsReadWriteContext &context)
 Reads the plot's properties from an XML element.
void setDataDefinedProperties (const QgsPropertyCollection &collection)
 Sets the plot's property collection, used for data defined overrides.
void setDataDefinedProperty (DataDefinedProperty key, const QgsProperty &property)
 Sets a data defined property for the plot.
virtual QString type () const
 Returns the plot's type.
virtual bool writeXml (QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const
 Writes the plot's properties into an XML element.

Static Public Member Functions

static const QgsPropertiesDefinitionpropertyDefinitions ()
 Returns the plot property definitions.

Protected Attributes

QgsPropertyCollection mDataDefinedProperties

Detailed Description

Base class for plot/chart/graphs.

Warning
This class is not considered stable API, and may change in future!
Since
QGIS 3.26

Definition at line 47 of file qgsplot.h.

Member Enumeration Documentation

◆ DataDefinedProperty

enum class QgsPlot::DataDefinedProperty : int
strong

Data defined properties for different plot types.

Since
QGIS 4.0
Enumerator
MarginLeft 

Left margin.

MarginTop 

Top margin.

MarginRight 

Right margin.

MarginBottom 

Bottom margin.

XAxisMajorInterval 

Major grid line interval for X axis.

XAxisMinorInterval 

Minor grid line interval for X axis.

XAxisLabelInterval 

Label interval for X axis.

YAxisMajorInterval 

Major grid line interval for Y axis.

YAxisMinorInterval 

Minor grid line interval for Y axis.

YAxisLabelInterval 

Label interval for Y axis.

XAxisMinimum 

Minimum X axis value.

XAxisMaximum 

Maximum X axis value.

YAxisMinimum 

Minimum Y axis value.

YAxisMaximum 

Maximum Y axis value.

Definition at line 95 of file qgsplot.h.

Constructor & Destructor Documentation

◆ QgsPlot()

QgsPlot::QgsPlot ( )
default

◆ ~QgsPlot()

QgsPlot::~QgsPlot ( )
virtualdefault

Member Function Documentation

◆ dataDefinedProperties() [1/2]

QgsPropertyCollection & QgsPlot::dataDefinedProperties ( )
inline

Returns a reference to the plot's property collection, used for data defined overrides.

See also
setDataDefinedProperties()
Since
QGIS 4.0

Definition at line 136 of file qgsplot.h.

◆ dataDefinedProperties() [2/2]

const QgsPropertyCollection & QgsPlot::dataDefinedProperties ( ) const
inline

Returns a reference to the plot's property collection, used for data defined overrides.

See also
setDataDefinedProperties()
Since
QGIS 4.0

Definition at line 143 of file qgsplot.h.

◆ propertyDefinitions()

const QgsPropertiesDefinition & QgsPlot::propertyDefinitions ( )
static

Returns the plot property definitions.

Definition at line 84 of file qgsplot.cpp.

◆ readXml()

bool QgsPlot::readXml ( const QDomElement & element,
const QgsReadWriteContext & context )
virtual

Reads the plot's properties from an XML element.

Reimplemented in Qgs2DPlot, Qgs2DXyPlot, QgsBarChartPlot, QgsLineChartPlot, and QgsPieChartPlot.

Definition at line 52 of file qgsplot.cpp.

◆ setDataDefinedProperties()

void QgsPlot::setDataDefinedProperties ( const QgsPropertyCollection & collection)
inline

Sets the plot's property collection, used for data defined overrides.

Parameters
collectionproperty collection. Existing properties will be replaced.
See also
dataDefinedProperties()
Since
QGIS 4.0

Definition at line 151 of file qgsplot.h.

◆ setDataDefinedProperty()

void QgsPlot::setDataDefinedProperty ( DataDefinedProperty key,
const QgsProperty & property )
inline

Sets a data defined property for the plot.

Any existing property with the same key will be overwritten.

See also
dataDefinedProperties()
Since
QGIS 4.0

Definition at line 129 of file qgsplot.h.

◆ type()

virtual QString QgsPlot::type ( ) const
inlinevirtual

Returns the plot's type.

Since
QGIS 4.0

Reimplemented in QgsBarChartPlot, QgsLineChartPlot, and QgsPieChartPlot.

Definition at line 121 of file qgsplot.h.

◆ writeXml()

bool QgsPlot::writeXml ( QDomElement & element,
QDomDocument & document,
const QgsReadWriteContext & context ) const
virtual

Writes the plot's properties into an XML element.

Reimplemented in Qgs2DPlot, Qgs2DXyPlot, QgsBarChartPlot, QgsLineChartPlot, and QgsPieChartPlot.

Definition at line 41 of file qgsplot.cpp.

Member Data Documentation

◆ mDataDefinedProperties

QgsPropertyCollection QgsPlot::mDataDefinedProperties
protected

Definition at line 169 of file qgsplot.h.


The documentation for this class was generated from the following files: