QgsDiagramSettings class

Stores the settings for rendering a single diagram.

QgsDiagramSettings stores the settings related to rendering the individual diagrams themselves, while QgsDiagramLayerSettings stores settings which control how ALL diagrams within a layer are rendered.

Public types

enum DiagramOrientation { Up, Down, Left, Right }
Orientation of histogram.

Constructors, destructors, conversion operators

QgsDiagramSettings() defaulted
Constructor for QgsDiagramSettings.

Public functions

auto legendItems(QgsLayerTreeLayer* nodeLayer) const -> QList<QgsLayerTreeModelLegendNode*>
Returns list of legend nodes for the diagram.
void readXml(const QDomElement& elem)
Reads diagram settings from XML.
void writeXml(QDomElement& rendererElem, QDomDocument& doc) const
Writes diagram settings to XML.

Public variables

QList<QString> categoryLabels
QgsMapUnitScale lineSizeScale
Line unit scale.
QgsUnitTypes::RenderUnit lineSizeUnit
Line unit index.
double maximumScale
The maximum map scale (i.e.
double minimumScale
The minimum map scale (i.e.
double minimumSize
Scale diagrams smaller than mMinimumSize to mMinimumSize.
double opacity
Opacity, from 0 (transparent) to 1.0 (opaque)
double rotationOffset
Rotation offset, in degrees clockwise from horizontal.
QgsMapUnitScale sizeScale
Diagram size unit scale.
QgsUnitTypes::RenderUnit sizeType
Diagram size unit.

Function documentation

QList<QgsLayerTreeModelLegendNode*> QgsDiagramSettings::legendItems(QgsLayerTreeLayer* nodeLayer) const

Returns list of legend nodes for the diagram.

Variable documentation

QList<QString> QgsDiagramSettings::categoryLabels

QgsMapUnitScale QgsDiagramSettings::lineSizeScale

Line unit scale.

QgsUnitTypes::RenderUnit QgsDiagramSettings::lineSizeUnit

Line unit index.

double QgsDiagramSettings::maximumScale

The maximum map scale (i.e.

most "zoomed in" scale) at which the diagrams will be visible. The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map. A scale of 0 indicates no maximum scale visibility.

double QgsDiagramSettings::minimumScale

The minimum map scale (i.e.

most "zoomed out" scale) at which the diagrams will be visible. The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map. A scale of 0 indicates no minimum scale visibility.

double QgsDiagramSettings::rotationOffset

Rotation offset, in degrees clockwise from horizontal.

QgsMapUnitScale QgsDiagramSettings::sizeScale

Diagram size unit scale.