QGIS API Documentation  2.99.0-Master (19b062c)
Public Types | Public Member Functions | Public Attributes | List of all members
QgsDiagramSettings Class Reference

Stores the settings for rendering a single diagram. More...

#include <qgsdiagramrenderer.h>

Public Types

enum  DiagramOrientation { Up, Down, Left, Right }
 Orientation of histogram. More...
 
enum  LabelPlacementMethod { Height, XHeight }
 

Public Member Functions

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

Public Attributes

QColor backgroundColor
 
double barWidth = 5.0
 
QList< QString > categoryAttributes
 
QList< QColor > categoryColors
 
QList< QString > categoryLabels
 
DiagramOrientation diagramOrientation = QgsDiagramSettings::Up
 
bool enabled = true
 
QFont font
 
LabelPlacementMethod labelPlacementMethod = QgsDiagramSettings::Height
 
QgsMapUnitScale lineSizeScale
 Line unit scale. More...
 
QgsUnitTypes::RenderUnit lineSizeUnit = QgsUnitTypes::RenderMillimeters
 Line unit index. More...
 
double maximumScale = 0
 The maximum map scale (i.e. More...
 
double minimumScale = 0
 The minimum map scale (i.e. More...
 
double minimumSize = 0.0
 Scale diagrams smaller than mMinimumSize to mMinimumSize. More...
 
double opacity = 1.0
 Opacity, from 0 (transparent) to 1.0 (opaque) More...
 
QColor penColor
 
double penWidth = 0.0
 
double rotationOffset = 270
 Rotation offset, in degrees clockwise from horizontal. More...
 
bool scaleBasedVisibility = false
 
bool scaleByArea = true
 
QSizeF size
 
QgsMapUnitScale sizeScale
 Diagram size unit scale. More...
 
QgsUnitTypes::RenderUnit sizeType = QgsUnitTypes::RenderMillimeters
 Diagram size unit. More...
 

Detailed Description

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.

Definition at line 376 of file qgsdiagramrenderer.h.

Member Enumeration Documentation

◆ DiagramOrientation

Orientation of histogram.

Enumerator
Up 
Down 
Left 
Right 

Definition at line 387 of file qgsdiagramrenderer.h.

◆ LabelPlacementMethod

Enumerator
Height 
XHeight 

Definition at line 380 of file qgsdiagramrenderer.h.

Constructor & Destructor Documentation

◆ QgsDiagramSettings()

QgsDiagramSettings::QgsDiagramSettings ( )
default

Constructor for QgsDiagramSettings.

Member Function Documentation

◆ legendItems()

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

Returns list of legend nodes for the diagram.

Note
caller is responsible for deletion of QgsLayerTreeModelLegendNodes
Since
QGIS 2.10

Definition at line 733 of file qgsdiagramrenderer.cpp.

◆ readXml()

void QgsDiagramSettings::readXml ( const QDomElement &  elem)

Reads diagram settings from XML.

Definition at line 170 of file qgsdiagramrenderer.cpp.

◆ writeXml()

void QgsDiagramSettings::writeXml ( QDomElement &  rendererElem,
QDomDocument &  doc 
) const

Writes diagram settings to XML.

Definition at line 314 of file qgsdiagramrenderer.cpp.

Member Data Documentation

◆ backgroundColor

QColor QgsDiagramSettings::backgroundColor

Definition at line 429 of file qgsdiagramrenderer.h.

◆ barWidth

double QgsDiagramSettings::barWidth = 5.0

Definition at line 434 of file qgsdiagramrenderer.h.

◆ categoryAttributes

QList< QString > QgsDiagramSettings::categoryAttributes

Definition at line 401 of file qgsdiagramrenderer.h.

◆ categoryColors

QList< QColor > QgsDiagramSettings::categoryColors

Definition at line 400 of file qgsdiagramrenderer.h.

◆ categoryLabels

QList< QString > QgsDiagramSettings::categoryLabels
Since
QGIS 2.10

Definition at line 403 of file qgsdiagramrenderer.h.

◆ diagramOrientation

DiagramOrientation QgsDiagramSettings::diagramOrientation = QgsDiagramSettings::Up

Definition at line 433 of file qgsdiagramrenderer.h.

◆ enabled

bool QgsDiagramSettings::enabled = true

Definition at line 398 of file qgsdiagramrenderer.h.

◆ font

QFont QgsDiagramSettings::font

Definition at line 399 of file qgsdiagramrenderer.h.

◆ labelPlacementMethod

LabelPlacementMethod QgsDiagramSettings::labelPlacementMethod = QgsDiagramSettings::Height

Definition at line 432 of file qgsdiagramrenderer.h.

◆ lineSizeScale

QgsMapUnitScale QgsDiagramSettings::lineSizeScale

Line unit scale.

Since
QGIS 2.16

Definition at line 427 of file qgsdiagramrenderer.h.

◆ lineSizeUnit

QgsUnitTypes::RenderUnit QgsDiagramSettings::lineSizeUnit = QgsUnitTypes::RenderMillimeters

Line unit index.

Since
QGIS 2.16

Definition at line 421 of file qgsdiagramrenderer.h.

◆ maximumScale

double QgsDiagramSettings::maximumScale = 0

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

Definition at line 455 of file qgsdiagramrenderer.h.

◆ minimumScale

double QgsDiagramSettings::minimumScale = 0

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
maximumScale

Definition at line 463 of file qgsdiagramrenderer.h.

◆ minimumSize

double QgsDiagramSettings::minimumSize = 0.0

Scale diagrams smaller than mMinimumSize to mMinimumSize.

Definition at line 466 of file qgsdiagramrenderer.h.

◆ opacity

double QgsDiagramSettings::opacity = 1.0

Opacity, from 0 (transparent) to 1.0 (opaque)

Definition at line 437 of file qgsdiagramrenderer.h.

◆ penColor

QColor QgsDiagramSettings::penColor

Definition at line 430 of file qgsdiagramrenderer.h.

◆ penWidth

double QgsDiagramSettings::penWidth = 0.0

Definition at line 431 of file qgsdiagramrenderer.h.

◆ rotationOffset

double QgsDiagramSettings::rotationOffset = 270

Rotation offset, in degrees clockwise from horizontal.

Since
QGIS 3.0

Definition at line 445 of file qgsdiagramrenderer.h.

◆ scaleBasedVisibility

bool QgsDiagramSettings::scaleBasedVisibility = false

Definition at line 447 of file qgsdiagramrenderer.h.

◆ scaleByArea

bool QgsDiagramSettings::scaleByArea = true

Definition at line 439 of file qgsdiagramrenderer.h.

◆ size

QSizeF QgsDiagramSettings::size

Definition at line 404 of file qgsdiagramrenderer.h.

◆ sizeScale

QgsMapUnitScale QgsDiagramSettings::sizeScale

Diagram size unit scale.

Since
QGIS 2.16

Definition at line 415 of file qgsdiagramrenderer.h.

◆ sizeType

Diagram size unit.

Definition at line 409 of file qgsdiagramrenderer.h.


The documentation for this class was generated from the following files: