|
QGIS API Documentation 3.99.0-Master (26c88405ac0)
|
A simple pie chart class. More...
#include <qgspiechartplot.h>

Public Member Functions | |
| QgsPieChartPlot () | |
| ~QgsPieChartPlot () override=default | |
| QgsColorRamp * | colorRampAt (int index) const |
| Returns the color ramp for the series with matching index. | |
| int | colorRampCount () const |
| Returns the color ramps list count. | |
| QgsFillSymbol * | fillSymbolAt (int index) const |
| Returns the fill symbol for the series with matching index. | |
| int | fillSymbolCount () const |
| Returns the fill symbols list count. | |
| Qgis::PieChartLabelType | labelType () const |
| Returns the pie chart label type. | |
| QgsNumericFormat * | numericFormat () const |
| Returns the numeric format used for the pie chart labels. | |
| bool | readXml (const QDomElement &element, const QgsReadWriteContext &context) override |
| Reads the plot's properties from an XML element. | |
| void | renderContent (QgsRenderContext &context, QgsPlotRenderContext &plotContext, const QRectF &plotArea, const QgsPlotData &plotData=QgsPlotData()) override |
| Renders the plot content. | |
| void | setColorRampAt (int index, QgsColorRamp *ramp) |
| Sets the color ramp for the series with matching index. | |
| void | setFillSymbolAt (int index, QgsFillSymbol *symbol) |
| Sets the fill symbol to use for the series with matching index. | |
| void | setLabelType (Qgis::PieChartLabelType type) |
| Sets the pie chart label type. | |
| void | setNumericFormat (QgsNumericFormat *format) |
| Sets the numeric format used for the pie chart labels. | |
| void | setTextFormat (const QgsTextFormat &format) |
| Sets the text format used for the pie chart labels. | |
| QgsTextFormat | textFormat () const |
| Returns the text format used for the pie chart labels. | |
| QString | type () const override |
| Returns the plot's type. | |
| 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 Qgs2DPlot | |
| 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 |
| virtual void | render (QgsRenderContext &context, QgsPlotRenderContext &plotContext, const QgsPlotData &plotData=QgsPlotData()) |
| Renders the plot. | |
| 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). | |
| 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. | |
Static Public Member Functions | |
| static QgsPieChartPlot * | create () |
| Returns a new pie chart. | |
| static QgsVectorLayerAbstractPlotDataGatherer * | createDataGatherer (QgsPlot *plot) |
| Returns a new data gatherer for a given pie chart plot. | |
| Static Public Member Functions inherited from QgsPlot | |
| static const QgsPropertiesDefinition & | propertyDefinitions () |
| Returns the plot property definitions. | |
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... | |
| Protected Member Functions inherited from Qgs2DPlot | |
| void | applyDataDefinedProperties (QgsRenderContext &context, QgsMargins &margins) const |
| Applies 2D plot data-defined properties. | |
| Protected Attributes inherited from QgsPlot | |
| QgsPropertyCollection | mDataDefinedProperties |
A simple pie chart class.
Definition at line 38 of file qgspiechartplot.h.
| QgsPieChartPlot::QgsPieChartPlot | ( | ) |
Definition at line 30 of file qgspiechartplot.cpp.
|
overridedefault |
| QgsColorRamp * QgsPieChartPlot::colorRampAt | ( | int | index | ) | const |
Returns the color ramp for the series with matching index.
Definition at line 281 of file qgspiechartplot.cpp.
|
inline |
Returns the color ramps list count.
Definition at line 80 of file qgspiechartplot.h.
|
static |
Returns a new pie chart.
Definition at line 412 of file qgspiechartplot.cpp.
|
static |
Returns a new data gatherer for a given pie chart plot.
Definition at line 417 of file qgspiechartplot.cpp.
| QgsFillSymbol * QgsPieChartPlot::fillSymbolAt | ( | int | index | ) | const |
Returns the fill symbol for the series with matching index.
Definition at line 256 of file qgspiechartplot.cpp.
|
inline |
Returns the fill symbols list count.
Definition at line 75 of file qgspiechartplot.h.
|
inline |
Returns the pie chart label type.
Definition at line 115 of file qgspiechartplot.h.
|
inline |
Returns the numeric format used for the pie chart labels.
Definition at line 101 of file qgspiechartplot.h.
|
overridevirtual |
Reads the plot's properties from an XML element.
Reimplemented from Qgs2DPlot.
Definition at line 352 of file qgspiechartplot.cpp.
|
overridevirtual |
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 from Qgs2DPlot.
Definition at line 37 of file qgspiechartplot.cpp.
| void QgsPieChartPlot::setColorRampAt | ( | int | index, |
| QgsColorRamp * | ramp ) |
Sets the color ramp for the series with matching index.
Definition at line 291 of file qgspiechartplot.cpp.
| void QgsPieChartPlot::setFillSymbolAt | ( | int | index, |
| QgsFillSymbol * | symbol ) |
Sets the fill symbol to use for the series with matching index.
Definition at line 266 of file qgspiechartplot.cpp.
| void QgsPieChartPlot::setLabelType | ( | Qgis::PieChartLabelType | type | ) |
Sets the pie chart label type.
Definition at line 438 of file qgspiechartplot.cpp.
| void QgsPieChartPlot::setNumericFormat | ( | QgsNumericFormat * | format | ) |
Sets the numeric format used for the pie chart labels.
Ownership of format is transferred to the plot.
Definition at line 433 of file qgspiechartplot.cpp.
| void QgsPieChartPlot::setTextFormat | ( | const QgsTextFormat & | format | ) |
Sets the text format used for the pie chart labels.
Definition at line 428 of file qgspiechartplot.cpp.
|
inline |
Returns the text format used for the pie chart labels.
Definition at line 87 of file qgspiechartplot.h.
|
inlineoverridevirtual |
Returns the plot's type.
Reimplemented from QgsPlot.
Definition at line 45 of file qgspiechartplot.h.
|
overridevirtual |
Writes the plot's properties into an XML element.
Reimplemented from Qgs2DPlot.
Definition at line 306 of file qgspiechartplot.cpp.