QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
Loading...
Searching...
No Matches
QgsPlotAxis Class Reference

Encapsulates the properties of a plot axis. More...

#include <qgsplot.h>

Public Member Functions

 QgsPlotAxis ()
 QgsPlotAxis (const QgsPlotAxis &other)=delete
 ~QgsPlotAxis ()
double gridIntervalMajor () const
 Returns the interval of major grid lines for the axis.
double gridIntervalMinor () const
 Returns the interval of minor grid lines for the axis.
QgsLineSymbolgridMajorSymbol ()
 Returns the line symbol used to render the major lines in the axis grid.
const QgsLineSymbolgridMajorSymbol () const
 Returns the line symbol used to render the major lines in the axis grid.
QgsLineSymbolgridMinorSymbol ()
 Returns the line symbol used to render the minor lines in the axis grid.
const QgsLineSymbolgridMinorSymbol () const
 Returns the line symbol used to render the major lines in the axis grid.
double labelInterval () const
 Returns the interval of labels for the axis.
QString labelSuffix () const
 Returns the axis label suffix, or an empty string if no label suffix is to be used.
Qgis::PlotAxisSuffixPlacement labelSuffixPlacement () const
 Returns the placement for the axis label suffixes.
QgsNumericFormatnumericFormat () const
 Returns the numeric format used for the axis labels.
QgsPlotAxisoperator= (const QgsPlotAxis &other)=delete
bool readXml (const QDomElement &element, const QgsReadWriteContext &context)
 Reads the axis' properties from an XML element.
void setGridIntervalMajor (double interval)
 Sets the interval of major grid lines for the axis.
void setGridIntervalMinor (double interval)
 Sets the interval of minor grid lines for the axis.
void setGridMajorSymbol (QgsLineSymbol *symbol)
 Sets the symbol used to render the major lines in the axis grid.
void setGridMinorSymbol (QgsLineSymbol *symbol)
 Sets the symbol used to render the minor lines in the axis grid.
void setLabelInterval (double interval)
 Sets the interval of labels for the axis.
void setLabelSuffix (const QString &suffix)
 Sets the axis label suffix.
void setLabelSuffixPlacement (Qgis::PlotAxisSuffixPlacement placement)
 Sets the placement for the axis label suffixes.
void setNumericFormat (QgsNumericFormat *format)
 Sets the numeric format used for the axis labels.
void setTextFormat (const QgsTextFormat &format)
 Sets the text format used for the axis labels.
void setType (Qgis::PlotAxisType type)
 Sets the axis type.
QgsTextFormat textFormat () const
 Returns the text format used for the axis labels.
Qgis::PlotAxisType type () const
 Returns the axis type.
bool writeXml (QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context) const
 Writes the axis' properties into an XML element.

Static Public Member Functions

static void copyProperties (const QgsPlotAxis &source, QgsPlotAxis &destination)
 Copies all properties from source axis to destination axis.

Detailed Description

Encapsulates the properties of a plot axis.

Warning
This class is not considered stable API, and may change in future!
Since
QGIS 3.26

Definition at line 353 of file qgsplot.h.

Constructor & Destructor Documentation

◆ QgsPlotAxis() [1/2]

QgsPlotAxis::QgsPlotAxis ( )

Definition at line 113 of file qgsplot.cpp.

◆ ~QgsPlotAxis()

QgsPlotAxis::~QgsPlotAxis ( )
default

◆ QgsPlotAxis() [2/2]

QgsPlotAxis::QgsPlotAxis ( const QgsPlotAxis & other)
delete

Member Function Documentation

◆ copyProperties()

void QgsPlotAxis::copyProperties ( const QgsPlotAxis & source,
QgsPlotAxis & destination )
static

Copies all properties from source axis to destination axis.

Since
QGIS 4.0

Definition at line 255 of file qgsplot.cpp.

◆ gridIntervalMajor()

double QgsPlotAxis::gridIntervalMajor ( ) const
inline

Returns the interval of major grid lines for the axis.

See also
setGridIntervalMajor()

Definition at line 403 of file qgsplot.h.

◆ gridIntervalMinor()

double QgsPlotAxis::gridIntervalMinor ( ) const
inline

Returns the interval of minor grid lines for the axis.

See also
setGridIntervalMinor()

Definition at line 389 of file qgsplot.h.

◆ gridMajorSymbol() [1/2]

QgsLineSymbol * QgsPlotAxis::gridMajorSymbol ( )

Returns the line symbol used to render the major lines in the axis grid.

See also
setGridMajorSymbol()

Definition at line 215 of file qgsplot.cpp.

◆ gridMajorSymbol() [2/2]

const QgsLineSymbol * QgsPlotAxis::gridMajorSymbol ( ) const

Returns the line symbol used to render the major lines in the axis grid.

See also
setGridMajorSymbol()
Note
not available in Python bindings
Since
QGIS 4.0

Definition at line 220 of file qgsplot.cpp.

◆ gridMinorSymbol() [1/2]

QgsLineSymbol * QgsPlotAxis::gridMinorSymbol ( )

Returns the line symbol used to render the minor lines in the axis grid.

See also
setGridMinorSymbol()

Definition at line 230 of file qgsplot.cpp.

◆ gridMinorSymbol() [2/2]

const QgsLineSymbol * QgsPlotAxis::gridMinorSymbol ( ) const

Returns the line symbol used to render the major lines in the axis grid.

See also
setGridMinorSymbol()
Note
not available in Python bindings
Since
QGIS 4.0

Definition at line 235 of file qgsplot.cpp.

◆ labelInterval()

double QgsPlotAxis::labelInterval ( ) const
inline

Returns the interval of labels for the axis.

See also
setLabelInterval()

Definition at line 417 of file qgsplot.h.

◆ labelSuffix()

QString QgsPlotAxis::labelSuffix ( ) const

Returns the axis label suffix, or an empty string if no label suffix is to be used.

See also
setLabelSuffix()
labelSuffixPlacement()
Since
QGIS 3.32

Definition at line 195 of file qgsplot.cpp.

◆ labelSuffixPlacement()

Qgis::PlotAxisSuffixPlacement QgsPlotAxis::labelSuffixPlacement ( ) const

Returns the placement for the axis label suffixes.

See also
setLabelSuffixPlacement()
labelSuffix()
Since
QGIS 3.32

Definition at line 205 of file qgsplot.cpp.

◆ numericFormat()

QgsNumericFormat * QgsPlotAxis::numericFormat ( ) const

Returns the numeric format used for the axis labels.

See also
setNumericFormat()

Definition at line 185 of file qgsplot.cpp.

◆ operator=()

QgsPlotAxis & QgsPlotAxis::operator= ( const QgsPlotAxis & other)
delete

◆ readXml()

bool QgsPlotAxis::readXml ( const QDomElement & element,
const QgsReadWriteContext & context )

Reads the axis' properties from an XML element.

Definition at line 161 of file qgsplot.cpp.

◆ setGridIntervalMajor()

void QgsPlotAxis::setGridIntervalMajor ( double interval)
inline

Sets the interval of major grid lines for the axis.

See also
gridIntervalMajor()

Definition at line 410 of file qgsplot.h.

◆ setGridIntervalMinor()

void QgsPlotAxis::setGridIntervalMinor ( double interval)
inline

Sets the interval of minor grid lines for the axis.

See also
gridIntervalMinor()

Definition at line 396 of file qgsplot.h.

◆ setGridMajorSymbol()

void QgsPlotAxis::setGridMajorSymbol ( QgsLineSymbol * symbol)

Sets the symbol used to render the major lines in the axis grid.

Ownership of symbol is transferred to the plot.

See also
gridMajorSymbol()

Definition at line 225 of file qgsplot.cpp.

◆ setGridMinorSymbol()

void QgsPlotAxis::setGridMinorSymbol ( QgsLineSymbol * symbol)

Sets the symbol used to render the minor lines in the axis grid.

Ownership of symbol is transferred to the plot.

See also
gridMinorSymbol()

Definition at line 240 of file qgsplot.cpp.

◆ setLabelInterval()

void QgsPlotAxis::setLabelInterval ( double interval)
inline

Sets the interval of labels for the axis.

See also
labelInterval()

Definition at line 424 of file qgsplot.h.

◆ setLabelSuffix()

void QgsPlotAxis::setLabelSuffix ( const QString & suffix)

Sets the axis label suffix.

Set to an empty string if no label suffix is to be used.

See also
labelSuffix()
setLabelSuffixPlacement()
Since
QGIS 3.32

Definition at line 200 of file qgsplot.cpp.

◆ setLabelSuffixPlacement()

void QgsPlotAxis::setLabelSuffixPlacement ( Qgis::PlotAxisSuffixPlacement placement)

Sets the placement for the axis label suffixes.

See also
labelSuffixPlacement()
setLabelSuffix()
Since
QGIS 3.32

Definition at line 210 of file qgsplot.cpp.

◆ setNumericFormat()

void QgsPlotAxis::setNumericFormat ( QgsNumericFormat * format)

Sets the numeric format used for the axis labels.

Ownership of format is transferred to the plot.

See also
numericFormat()

Definition at line 190 of file qgsplot.cpp.

◆ setTextFormat()

void QgsPlotAxis::setTextFormat ( const QgsTextFormat & format)

Sets the text format used for the axis labels.

See also
textFormat()

Definition at line 250 of file qgsplot.cpp.

◆ setType()

void QgsPlotAxis::setType ( Qgis::PlotAxisType type)

Sets the axis type.

Since
QGIS 4.0

Definition at line 129 of file qgsplot.cpp.

◆ textFormat()

QgsTextFormat QgsPlotAxis::textFormat ( ) const

Returns the text format used for the axis labels.

See also
setTextFormat()

Definition at line 245 of file qgsplot.cpp.

◆ type()

Qgis::PlotAxisType QgsPlotAxis::type ( ) const

Returns the axis type.

Since
QGIS 4.0

Definition at line 124 of file qgsplot.cpp.

◆ writeXml()

bool QgsPlotAxis::writeXml ( QDomElement & element,
QDomDocument & document,
const QgsReadWriteContext & context ) const

Writes the axis' properties into an XML element.

Definition at line 134 of file qgsplot.cpp.


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