QGIS API Documentation  3.4.15-Madeira (e83d02e274)
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 378 of file qgsdiagramrenderer.h.

Member Enumeration Documentation

Orientation of histogram.

Enumerator
Up 
Down 
Left 
Right 

Definition at line 389 of file qgsdiagramrenderer.h.

Enumerator
Height 
XHeight 

Definition at line 382 of file qgsdiagramrenderer.h.

Constructor & Destructor Documentation

QgsDiagramSettings::QgsDiagramSettings ( )
default

Constructor for QgsDiagramSettings.

Member Function Documentation

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.

void QgsDiagramSettings::readXml ( const QDomElement &  elem)

Reads diagram settings from XML.

Definition at line 170 of file qgsdiagramrenderer.cpp.

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

Writes diagram settings to XML.

Definition at line 314 of file qgsdiagramrenderer.cpp.

Member Data Documentation

QColor QgsDiagramSettings::backgroundColor

Definition at line 431 of file qgsdiagramrenderer.h.

double QgsDiagramSettings::barWidth = 5.0

Definition at line 436 of file qgsdiagramrenderer.h.

QList< QString > QgsDiagramSettings::categoryAttributes

Definition at line 403 of file qgsdiagramrenderer.h.

QList< QColor > QgsDiagramSettings::categoryColors

Definition at line 402 of file qgsdiagramrenderer.h.

QList< QString > QgsDiagramSettings::categoryLabels
Since
QGIS 2.10

Definition at line 405 of file qgsdiagramrenderer.h.

DiagramOrientation QgsDiagramSettings::diagramOrientation = QgsDiagramSettings::Up

Definition at line 435 of file qgsdiagramrenderer.h.

bool QgsDiagramSettings::enabled = true

Definition at line 400 of file qgsdiagramrenderer.h.

QFont QgsDiagramSettings::font

Definition at line 401 of file qgsdiagramrenderer.h.

LabelPlacementMethod QgsDiagramSettings::labelPlacementMethod = QgsDiagramSettings::Height

Definition at line 434 of file qgsdiagramrenderer.h.

QgsMapUnitScale QgsDiagramSettings::lineSizeScale

Line unit scale.

Since
QGIS 2.16

Definition at line 429 of file qgsdiagramrenderer.h.

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

Line unit index.

Since
QGIS 2.16

Definition at line 423 of file qgsdiagramrenderer.h.

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 457 of file qgsdiagramrenderer.h.

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 465 of file qgsdiagramrenderer.h.

double QgsDiagramSettings::minimumSize = 0.0

Scale diagrams smaller than mMinimumSize to mMinimumSize.

Definition at line 468 of file qgsdiagramrenderer.h.

double QgsDiagramSettings::opacity = 1.0

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

Definition at line 439 of file qgsdiagramrenderer.h.

QColor QgsDiagramSettings::penColor

Definition at line 432 of file qgsdiagramrenderer.h.

double QgsDiagramSettings::penWidth = 0.0

Definition at line 433 of file qgsdiagramrenderer.h.

double QgsDiagramSettings::rotationOffset = 270

Rotation offset, in degrees clockwise from horizontal.

Since
QGIS 3.0

Definition at line 447 of file qgsdiagramrenderer.h.

bool QgsDiagramSettings::scaleBasedVisibility = false

Definition at line 449 of file qgsdiagramrenderer.h.

bool QgsDiagramSettings::scaleByArea = true

Definition at line 441 of file qgsdiagramrenderer.h.

QSizeF QgsDiagramSettings::size

Definition at line 406 of file qgsdiagramrenderer.h.

QgsMapUnitScale QgsDiagramSettings::sizeScale

Diagram size unit scale.

Since
QGIS 2.16

Definition at line 417 of file qgsdiagramrenderer.h.

Diagram size unit.

Definition at line 411 of file qgsdiagramrenderer.h.


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