|
QGIS API Documentation 3.99.0-Master (26c88405ac0)
|
Base class for 2-dimensional plot/chart/graphs. More...
#include <qgsplot.h>

Public Member Functions | |
| Qgs2DPlot () | |
| Constructor for Qgs2DPlot. | |
| Qgs2DPlot (const Qgs2DPlot &other)=delete | |
| ~Qgs2DPlot () override | |
| virtual QRectF | interiorPlotArea (QgsRenderContext &context, QgsPlotRenderContext &plotContext) const |
| Returns the area of the plot which corresponds to the actual plot content (excluding all titles and other components which sit outside the plot area). | |
| const QgsMargins & | margins () const |
| Returns the margins of the plot area (in millimeters). | |
| Qgs2DPlot & | operator= (const Qgs2DPlot &other)=delete |
| bool | readXml (const QDomElement &element, const QgsReadWriteContext &context) override |
| Reads the plot's properties from an XML element. | |
| virtual void | render (QgsRenderContext &context, QgsPlotRenderContext &plotContext, const QgsPlotData &plotData=QgsPlotData()) |
| Renders the plot. | |
| virtual void | renderContent (QgsRenderContext &context, QgsPlotRenderContext &plotContext, const QRectF &plotArea, const QgsPlotData &plotData=QgsPlotData()) |
| Renders the plot content. | |
| void | setMargins (const QgsMargins &margins) |
| Sets the margins of the plot area (in millimeters). | |
| void | setSize (QSizeF size) |
| Sets the overall size of the plot (including titles and over components which sit outside the plot area). | |
| QSizeF | size () const |
| Returns the overall size of the plot (in millimeters) (including titles and other components which sit outside the plot area). | |
| bool | writeXml (QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const override |
| Writes the plot's properties into an XML element. | |
| Public Member Functions inherited from QgsPlot | |
| QgsPlot ()=default | |
| virtual | ~QgsPlot () |
| QgsPropertyCollection & | dataDefinedProperties () |
| Returns a reference to the plot's property collection, used for data defined overrides. | |
| const QgsPropertyCollection & | dataDefinedProperties () const |
| Returns a reference to the plot's property collection, used for data defined overrides. | |
| 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. | |
Protected Member Functions | |
| void | applyDataDefinedProperties (QgsRenderContext &context, QgsMargins &margins) const |
| Applies 2D plot data-defined properties. | |
Friends | |
| class | Qgs2DXyPlot |
Additional Inherited Members | |
| Public Types inherited from QgsPlot | |
| 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... | |
| Static Public Member Functions inherited from QgsPlot | |
| static const QgsPropertiesDefinition & | propertyDefinitions () |
| Returns the plot property definitions. | |
| Protected Attributes inherited from QgsPlot | |
| QgsPropertyCollection | mDataDefinedProperties |
Base class for 2-dimensional plot/chart/graphs.
| Qgs2DPlot::Qgs2DPlot | ( | ) |
Constructor for Qgs2DPlot.
Definition at line 229 of file qgsplot.cpp.
|
overridedefault |
|
delete |
|
protected |
Applies 2D plot data-defined properties.
Definition at line 302 of file qgsplot.cpp.
|
virtual |
Returns the area of the plot which corresponds to the actual plot content (excluding all titles and other components which sit outside the plot area).
Reimplemented in Qgs2DXyPlot.
Definition at line 279 of file qgsplot.cpp.
| const QgsMargins & Qgs2DPlot::margins | ( | ) | const |
Returns the margins of the plot area (in millimeters).
Definition at line 292 of file qgsplot.cpp.
|
overridevirtual |
Reads the plot's properties from an XML element.
Reimplemented from QgsPlot.
Reimplemented in Qgs2DXyPlot, QgsBarChartPlot, QgsLineChartPlot, and QgsPieChartPlot.
Definition at line 243 of file qgsplot.cpp.
|
virtual |
|
virtual |
Renders the plot content.
Subclasses can implement this method to render the actual plot content (e.g. bar charts, scatter plots). This method will be called after the chart background and grid are rendered, but before the chart border is rendered.
The default implementation does nothing.
The plotArea argument specifies that area of the plot which corresponds to the actual plot content. Implementations should take care to scale values accordingly to render points correctly inside this plot area.
Reimplemented in QgsBarChartPlot, QgsLineChartPlot, and QgsPieChartPlot.
Definition at line 263 of file qgsplot.cpp.
| void Qgs2DPlot::setMargins | ( | const QgsMargins & | margins | ) |
Sets the margins of the plot area (in millimeters).
Definition at line 297 of file qgsplot.cpp.
| void Qgs2DPlot::setSize | ( | QSizeF | size | ) |
Sets the overall size of the plot (including titles and over components which sit outside the plot area).
Definition at line 274 of file qgsplot.cpp.
| QSizeF Qgs2DPlot::size | ( | ) | const |
Returns the overall size of the plot (in millimeters) (including titles and other components which sit outside the plot area).
Definition at line 269 of file qgsplot.cpp.
|
overridevirtual |
Writes the plot's properties into an XML element.
Reimplemented from QgsPlot.
Reimplemented in Qgs2DXyPlot, QgsBarChartPlot, QgsLineChartPlot, and QgsPieChartPlot.
Definition at line 234 of file qgsplot.cpp.
|
friend |