|
QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
|
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 | |
| void | copyCommonProperties (const Qgs2DPlot *other) |
| Copies all Qgs2DPlot-level properties (size, margins, data-defined properties) from other to this plot. | |
| virtual QRectF | interiorPlotArea (QgsRenderContext &context, QgsPlotRenderContext &plotContext, const QgsPlotData &plotData=QgsPlotData()) 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. | |
| virtual void | initFromPlot (const QgsPlot *plot) |
| Initializes properties of this plot from an existing plot, transferring all applicable settings. | |
| 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 277 of file qgsplot.cpp.
|
overridedefault |
|
delete |
|
protected |
Applies 2D plot data-defined properties.
Definition at line 348 of file qgsplot.cpp.
| void Qgs2DPlot::copyCommonProperties | ( | const Qgs2DPlot * | other | ) |
Copies all Qgs2DPlot-level properties (size, margins, data-defined properties) from other to this plot.
Definition at line 397 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).
The optional plotData argument can be passed on to support calculation of label sizes when an axis' type is categorical.
Reimplemented in Qgs2DXyPlot.
Definition at line 325 of file qgsplot.cpp.
| const QgsMargins & Qgs2DPlot::margins | ( | ) | const |
Returns the margins of the plot area (in millimeters).
Definition at line 338 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 290 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 310 of file qgsplot.cpp.
| void Qgs2DPlot::setMargins | ( | const QgsMargins & | margins | ) |
Sets the margins of the plot area (in millimeters).
Definition at line 343 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 320 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 315 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 281 of file qgsplot.cpp.
|
friend |