QGIS API Documentation 3.99.0-Master (21b3aa880ba)
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.
QgsLineSymbolgridMinorSymbol ()
 Returns the line symbol used to render the minor 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.

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 352 of file qgsplot.h.

Constructor & Destructor Documentation

◆ QgsPlotAxis() [1/2]

QgsPlotAxis::QgsPlotAxis ( )

Definition at line 92 of file qgsplot.cpp.

◆ ~QgsPlotAxis()

QgsPlotAxis::~QgsPlotAxis ( )
default

◆ QgsPlotAxis() [2/2]

QgsPlotAxis::QgsPlotAxis ( const QgsPlotAxis & other)
delete

Member Function Documentation

◆ 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()

QgsLineSymbol * QgsPlotAxis::gridMajorSymbol ( )

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

See also
setGridMajorSymbol()

Definition at line 194 of file qgsplot.cpp.

◆ gridMinorSymbol()

QgsLineSymbol * QgsPlotAxis::gridMinorSymbol ( )

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

See also
setGridMinorSymbol()

Definition at line 204 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 174 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 184 of file qgsplot.cpp.

◆ numericFormat()

QgsNumericFormat * QgsPlotAxis::numericFormat ( ) const

Returns the numeric format used for the axis labels.

See also
setNumericFormat()

Definition at line 164 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 140 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 199 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 209 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 179 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 189 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 169 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 219 of file qgsplot.cpp.

◆ setType()

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

Sets the axis type.

Since
QGIS 4.0

Definition at line 108 of file qgsplot.cpp.

◆ textFormat()

QgsTextFormat QgsPlotAxis::textFormat ( ) const

Returns the text format used for the axis labels.

See also
setTextFormat()

Definition at line 214 of file qgsplot.cpp.

◆ type()

Qgis::PlotAxisType QgsPlotAxis::type ( ) const

Returns the axis type.

Since
QGIS 4.0

Definition at line 103 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 113 of file qgsplot.cpp.


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