Class: QgsStackedDiagramRenderer¶
Renders diagrams using mixed diagram render types.
The size of the rendered diagram is given by a combination of subrenderers.
Added in version 3.40.
Class Hierarchy¶
Base classes¶
Evaluates and returns the diagram settings relating to a diagram for a specific feature. |
Abstract Methods
Returns list with all diagram settings in the renderer |
Methods
Adds a renderer to the stacked renderer object. |
|
Returns the renderer at the given index. |
|
Returns the number of sub renderers in the stacked diagram renderer |
|
Returns an ordered list with the renderers of the stacked renderer object. |
|
Virtual Methods
In PyQGIS, only methods marked as virtual
can be safely overridden in a Python subclass of QgsStackedDiagramRenderer. See the FAQ for more details.
Renders the diagram for a specified feature at a specific position in the passed render context, taking all renderers and their own diagrams into account. |
- class qgis.core.QgsStackedDiagramRenderer[source]¶
Bases:
QgsDiagramRenderer
- addRenderer(self, renderer: QgsDiagramRenderer | None)[source]¶
Adds a renderer to the stacked renderer object. Takes ownership.
Renderers added first will render their diagrams first, i.e., more to the left (horizontal mode) or more to the top (vertical mode).
- Parameters:
renderer (Optional[QgsDiagramRenderer]) – diagram renderer to be added to the stacked renderer
- abstract diagramSettings(self) List[QgsDiagramSettings] [source]¶
Returns list with all diagram settings in the renderer
- Return type:
List[QgsDiagramSettings]
- abstract diagramSettings(self, feature: QgsFeature, c: QgsRenderContext, s: QgsDiagramSettings) bool [source]
- Parameters:
feature (
QgsFeature
)c (
QgsRenderContext
)
- Return type:
bool
- virtual renderDiagram(self, feature: QgsFeature, c: QgsRenderContext, pos: QPointF | QPoint, properties: QgsPropertyCollection = QgsPropertyCollection())[source]¶
Renders the diagram for a specified feature at a specific position in the passed render context, taking all renderers and their own diagrams into account. Diagram rendering is delegated to renderer’s diagram.
- Parameters:
feature (QgsFeature)
c (QgsRenderContext)
pos (Union[QPointF, QPoint])
properties (
QgsPropertyCollection
= QgsPropertyCollection())
- renderer(self, index: int) QgsDiagramRenderer | None [source]¶
Returns the renderer at the given
index
. Does not transfer ownership.- Parameters:
index (int) – index of the desired renderer in the stacked renderer
- Return type:
Optional[QgsDiagramRenderer]
- rendererCount(self) int [source]¶
Returns the number of sub renderers in the stacked diagram renderer
- Return type:
int
- renderers(self, sortByDiagramMode: bool = False) List[QgsDiagramRenderer] ¶
Returns an ordered list with the renderers of the stacked renderer object. Does not transfer ownership.
- Parameters:
sortByDiagramMode (bool = False) – If true, the list is returned backwards for vertical orientation.
- Return type:
List[QgsDiagramRenderer]
- setDiagramSettings(self, s: QgsDiagramSettings)[source]¶
- Parameters: