Class: QgsDiagramSettings¶
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.
Methods
Returns the line symbol to use for rendering axis in diagrams.  | 
|
Returns the chart's angular direction.  | 
|
Returns list of legend nodes for the diagram  | 
|
Returns the paint effect to use while rendering diagrams.  | 
|
Reads diagram settings from XML  | 
|
Sets the line symbol to use for rendering axis in diagrams.  | 
|
Sets the chart's angular direction.  | 
|
Sets the paint effect to use while rendering diagrams.  | 
|
Sets whether the diagram axis should be shown.  | 
|
Sets the spacing between diagram contents.  | 
|
Sets the map unit scale for the content spacing.  | 
|
Sets the unit for the content spacing.  | 
|
Sets the spacing between subdiagrams in a stacked diagram.  | 
|
Sets the map unit scale for the spacing between subdiagrams in a stacked diagram.  | 
|
Sets the unit for the spacing between subdiagrams in a stacked diagram.  | 
|
Returns   | 
|
Returns the spacing between diagram contents.  | 
|
Returns the map unit scale for the content spacing.  | 
|
Returns the units for the content spacing.  | 
|
Returns the spacing between subdiagrams in a stacked diagram.  | 
|
Returns the map unit scale for the spacing between subdiagrams in a stacked diagram.  | 
|
Returns the units for the spacing between subdiagrams in a stacked diagram.  | 
|
Writes diagram settings to XML  | 
Attributes
Line unit scale  | 
|
Line unit index  | 
|
The maximum map scale (i.e. most "zoomed in" scale) at which the diagrams will be visible.  | 
|
The minimum map scale (i.e. most "zoomed out" scale) at which the diagrams will be visible.  | 
|
Scale diagrams smaller than mMinimumSize to mMinimumSize  | 
|
Opacity, from 0 (transparent) to 1.0 (opaque)  | 
|
Rotation offset, in degrees clockwise from horizontal.  | 
|
Diagram size unit scale  | 
|
Diagram size unit  | 
|
- class qgis.core.QgsDiagramSettings[source]¶
 Bases:
object- Clockwise = 0¶
 
- Counterclockwise = 1¶
 
- class DiagramOrientation¶
 Bases:
int
- class Direction¶
 Bases:
int
- Down = 1¶
 
- Height = 0¶
 
- Horizontal = 0¶
 
- class LabelPlacementMethod¶
 Bases:
int
- Left = 2¶
 
- Right = 3¶
 
- class StackedDiagramMode¶
 Bases:
int
- Up = 0¶
 
- Vertical = 1¶
 
- XHeight = 1¶
 
- axisLineSymbol(self) QgsLineSymbol | None[source]¶
 Returns the line symbol to use for rendering axis in diagrams.
See also
See also
Added in version 3.12.
- Return type:
 Optional[QgsLineSymbol]
- backgroundColor¶
 
- barWidth¶
 
- categoryAttributes¶
 
- categoryColors¶
 
- categoryLabels¶
 
- diagramOrientation¶
 
- direction(self) QgsDiagramSettings.Direction[source]¶
 Returns the chart’s angular direction.
See also
Added in version 3.12.
- Return type:
 
- enabled¶
 
- font¶
 
- labelPlacementMethod¶
 
- legendItems(self, nodeLayer: QgsLayerTreeLayer | None) List[QgsLayerTreeModelLegendNode]¶
 Returns list of legend nodes for the diagram
Note
caller is responsible for deletion of
QgsLayerTreeModelLegendNodes- Parameters:
 nodeLayer (Optional[QgsLayerTreeLayer])
- Return type:
 
- lineSizeScale¶
 Line unit scale
- lineSizeUnit¶
 Line unit index
- 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.
See also
- 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.
See also
- minimumSize¶
 Scale diagrams smaller than mMinimumSize to mMinimumSize
- opacity¶
 Opacity, from 0 (transparent) to 1.0 (opaque)
- paintEffect(self) QgsPaintEffect | None[source]¶
 Returns the paint effect to use while rendering diagrams.
See also
Added in version 3.12.
- Return type:
 Optional[QgsPaintEffect]
- penColor¶
 
- penWidth¶
 
- readXml(self, elem: QDomElement, context: QgsReadWriteContext = QgsReadWriteContext())[source]¶
 Reads diagram settings from XML
- Parameters:
 elem (QDomElement)
context (
QgsReadWriteContext= QgsReadWriteContext())
- rotationOffset¶
 Rotation offset, in degrees clockwise from horizontal.
- scaleBasedVisibility¶
 
- scaleByArea¶
 
- setAxisLineSymbol(self, symbol: QgsLineSymbol | None)[source]¶
 Sets the line
symbolto use for rendering axis in diagrams.Ownership of
symbolis transferred to the settings.See also
See also
Added in version 3.12.
- Parameters:
 symbol (Optional[QgsLineSymbol])
- setDirection(self, direction: QgsDiagramSettings.Direction)[source]¶
 Sets the chart’s angular
direction.See also
Added in version 3.12.
- Parameters:
 direction (QgsDiagramSettings.Direction)
- setPaintEffect(self, effect: QgsPaintEffect | None)[source]¶
 Sets the paint
effectto use while rendering diagrams.Ownership of
effectis transferred to the settings.See also
Added in version 3.12.
- Parameters:
 effect (Optional[QgsPaintEffect])
- setShowAxis(self, showAxis: bool)[source]¶
 Sets whether the diagram axis should be shown.
See also
See also
Added in version 3.12.
- Parameters:
 showAxis (bool)
- setSpacing(self, spacing: float)[source]¶
 Sets the
spacingbetween diagram contents.Spacing units are set via
setSpacingUnit().See also
See also
See also
Added in version 3.12.
- Parameters:
 spacing (float)
- setSpacingMapUnitScale(self, scale: QgsMapUnitScale)[source]¶
 Sets the map unit
scalefor the content spacing.See also
See also
See also
Added in version 3.12.
- Parameters:
 scale (QgsMapUnitScale)
- setSpacingUnit(self, unit: Qgis.RenderUnit)[source]¶
 Sets the
unitfor the content spacing.See also
See also
See also
Added in version 3.12.
- Parameters:
 unit (Qgis.RenderUnit)
- setStackedDiagramSpacing(self, spacing: float)[source]¶
 Sets the
spacingbetween subdiagrams in a stacked diagram.Spacing units are set via
setStackedDiagramSpacingUnit().See also
See also
Added in version 3.40.
- Parameters:
 spacing (float)
- setStackedDiagramSpacingMapUnitScale(self, scale: QgsMapUnitScale)[source]¶
 Sets the map unit
scalefor the spacing between subdiagrams in a stacked diagram.See also
See also
See also
Added in version 3.40.
- Parameters:
 scale (QgsMapUnitScale)
- setStackedDiagramSpacingUnit(self, unit: Qgis.RenderUnit)[source]¶
 Sets the
unitfor the spacing between subdiagrams in a stacked diagram.See also
See also
Added in version 3.40.
- Parameters:
 unit (Qgis.RenderUnit)
- showAxis(self) bool[source]¶
 Returns
Trueif the diagram axis should be shown.See also
See also
Added in version 3.12.
- Return type:
 bool
- size¶
 
- sizeScale¶
 Diagram size unit scale
- sizeType¶
 Diagram size unit
- spacing(self) float[source]¶
 Returns the spacing between diagram contents.
Spacing units can be retrieved by calling
spacingUnit().See also
See also
See also
Added in version 3.12.
- Return type:
 float
- spacingMapUnitScale(self) QgsMapUnitScale¶
 Returns the map unit scale for the content spacing.
See also
See also
See also
Added in version 3.12.
- Return type:
 
- spacingUnit(self) Qgis.RenderUnit[source]¶
 Returns the units for the content spacing.
See also
See also
See also
Added in version 3.12.
- Return type:
 
- stackedDiagramMode¶
 
- stackedDiagramSpacing(self) float[source]¶
 Returns the spacing between subdiagrams in a stacked diagram.
Spacing units can be retrieved by calling
stackedDiagramSpacingUnit().See also
See also
See also
Added in version 3.40.
- Return type:
 float
- stackedDiagramSpacingMapUnitScale(self) QgsMapUnitScale¶
 Returns the map unit scale for the spacing between subdiagrams in a stacked diagram.
See also
See also
See also
Added in version 3.40.
- Return type:
 
- stackedDiagramSpacingUnit(self) Qgis.RenderUnit[source]¶
 Returns the units for the spacing between subdiagrams in a stacked diagram.
See also
See also
See also
Added in version 3.40.
- Return type:
 
- writeXml(self, rendererElem: QDomElement, doc: QDomDocument, context: QgsReadWriteContext = QgsReadWriteContext())[source]¶
 Writes diagram settings to XML
- Parameters:
 rendererElem (QDomElement)
doc (QDomDocument)
context (
QgsReadWriteContext= QgsReadWriteContext())