- Qt 6.10
- Qt Graphs
- C++ Classes
- QtGraphs
- QAbstract3DAxis
- Qt Graphs | Commercial or GPLv3

# QAbstract3DAxis Class

The QAbstract3DAxis class is a base class for the axes of a 3D graph. More...

Header: | `#include <QAbstract3DAxis>`
CMake: | `find_package(Qt6 REQUIRED COMPONENTS Graphs)` `target_link_libraries(mytarget PRIVATE Qt6::Graphs)`
qmake: | `QT += graphs`
In QML: | Abstract3DAxis
Inherits: | QObject
Inherited By: | QCategory3DAxis and QValue3DAxis

- List of all members, including inherited members
- QAbstract3DAxis is part of Qt Graphs C++ Classes for 3D.

## Public Types

enum class | AxisOrientation { None, X, Y, Z }
enum class | AxisType { None, Category, Value }

## Properties

autoAdjustRange : bool labelAutoAngle : float `(since 6.9)` labelSize : qreal labels : QStringList labelsVisible : bool max : float min : float | orientation : const QAbstract3DAxis::AxisOrientation `(since 6.9)` scaleLabelsByCount : bool title : QString titleFixed : bool titleOffset : float titleVisible : bool type : const QAbstract3DAxis::AxisType

## Public Functions

virtual | ~QAbstract3DAxis() override
bool | isAutoAdjustRange() const
bool | isScaleLabelsByCount() const
bool | isTitleFixed() const
bool | isTitleVisible() const
float | labelAutoAngle() const
qreal | labelSize() const
QStringList | labels() const
bool | labelsVisible() const
float | max() const
float | min() const
QAbstract3DAxis::AxisOrientation | orientation() const
void | setAutoAdjustRange(bool autoAdjust)
void | setLabelAutoAngle(float degree)
void | setLabelSize(qreal size)
void | setLabels(const QStringList &labels)
void | setLabelsVisible(bool visible)
void | setMax(float max)
void | setMin(float min)
void | setRange(float min, float max)
void | setScaleLabelsByCount(bool adjust)
void | setTitle(const QString &title)
void | setTitleFixed(bool fixed)
void | setTitleOffset(float offset)
void | setTitleVisible(bool visible)
QString | title() const
float | titleOffset() const
QAbstract3DAxis::AxisType | type() const

## Signals

void | autoAdjustRangeChanged(bool autoAdjust)
void | labelAutoAngleChanged(float angle)
void | labelSizeChanged(qreal size)
void | labelVisibleChanged(bool visible)
void | labelsChanged()
void | maxChanged(float value)
void | minChanged(float value)
void | orientationChanged(QAbstract3DAxis::AxisOrientation orientation)
void | rangeChanged(float min, float max)
void | scaleLabelsByCountChanged(bool adjust)
void | titleChanged(const QString &newTitle)
void | titleFixedChanged(bool fixed)
void | titleOffsetChanged(float offset)
void | titleVisibleChanged(bool visible)

## Detailed Description

This class specifies the enumerations, properties, and functions shared by graph axes. It should not be used directly, but one of its subclasses should be used instead.

See also QCategory3DAxis and QValue3DAxis.

## Member Type Documentation

### enum class QAbstract3DAxis::AxisOrientation

The orientation of the axis object.

Constant | Value
--- | ---
`QAbstract3DAxis::AxisOrientation::None` | `0`
`QAbstract3DAxis::AxisOrientation::X` | `1`
`QAbstract3DAxis::AxisOrientation::Y` | `2`
`QAbstract3DAxis::AxisOrientation::Z` | `3`

### enum class QAbstract3DAxis::AxisType

The type of the axis object.

Constant | Value
--- | ---
`QAbstract3DAxis::AxisType::None` | `0`
`QAbstract3DAxis::AxisType::Category` | `1`
`QAbstract3DAxis::AxisType::Value` | `2`

## Property Documentation

### autoAdjustRange : bool

This property holds whether the axis will automatically adjust the range so that all data fits in it.

Access functions:

bool | isAutoAdjustRange() const
void | setAutoAdjustRange(bool autoAdjust)

Notifier signal:

void | autoAdjustRangeChanged(bool autoAdjust)

See also setRange(), setMin(), and setMax().

### labelAutoAngle : float

This property holds the maximum angle the labels can autorotate when the camera angle changes.

The angle can be between 0 and 90, inclusive. The default value is 0. If the value is 0, axis labels do not automatically rotate. If the value is greater than zero, labels attempt to orient themselves toward the camera, up to the specified angle.

Access functions:

float | labelAutoAngle() const
void | setLabelAutoAngle(float degree)

Notifier signal:

void | labelAutoAngleChanged(float angle)

### `[since 6.9]` labelSize : qreal

Size of the label

The size of the label. The default for this value is `1.0`.

This property was introduced in Qt 6.9.

Access functions:

qreal | labelSize() const
void | setLabelSize(qreal size)

Notifier signal:

void | labelSizeChanged(qreal size)

See also scaleLabelsByCount.

### labels : QStringList

This property holds the labels for the axis.

Note: Setting this property for QValue3DAxis does nothing, as it generates labels automatically.

Access functions:

QStringList | labels() const
void | setLabels(const QStringList &labels)

Notifier signal:

void | labelsChanged()

### labelsVisible : bool

This property holds whether the axis labels are visible in the primary graph view.

The default value is `true`.

Access functions:

bool | labelsVisible() const
void | setLabelsVisible(bool visible)

Notifier signal:

void | labelVisibleChanged(bool visible)

### max : float

This property holds the maximum value on the axis.

When setting this property, the minimum value is adjusted if necessary, to ensure that the range remains valid.

Note: For QCategory3DAxis, specifies the index of the last row or column to show.

Access functions:

float | max() const
void | setMax(float max)

Notifier signal:

void | maxChanged(float value)

### min : float

This property holds the minimum value on the axis.

When setting this property, the maximum value is adjusted if necessary, to ensure that the range remains valid.

Note: For QCategory3DAxis, specifies the index of the first row or column to show.

Access functions:

float | min() const
void | setMin(float min)

Notifier signal:

void | minChanged(float value)

### `[read-only]` orientation : const QAbstract3DAxis::AxisOrientation

This property holds the orientation of the axis.

The value is one of AxisOrientation values.

Access functions:

QAbstract3DAxis::AxisOrientation | orientation() const

Notifier signal:

void | orientationChanged(QAbstract3DAxis::AxisOrientation orientation)

### `[since 6.9]` scaleLabelsByCount : bool

This property holds whether the labels will automatically adjust their size based on the total amount of labels

This property was introduced in Qt 6.9.

Access functions:

bool | isScaleLabelsByCount() const
void | setScaleLabelsByCount(bool adjust)

Notifier signal:

void | scaleLabelsByCountChanged(bool adjust)

See also labelSize().

### title : QString

This property holds the title for the axis.

Access functions:

QString | title() const
void | setTitle(const QString &title)

Notifier signal:

void | titleChanged(const QString &newTitle)

See also titleVisible and titleFixed.

### titleFixed : bool

This property holds the rotation of the axis titles.

If `false`, axis titles in the primary graph view will be rotated towards the camera similarly to the axis labels. If `true`, axis titles are only rotated around their axis but are not otherwise oriented towards the camera. This property does not have any effect if the labelAutoAngle property value is zero. Default value is `true`.

Access functions:

bool | isTitleFixed() const
void | setTitleFixed(bool fixed)

Notifier signal:

void | titleFixedChanged(bool fixed)

See also labelAutoAngle, title, and titleVisible.

### titleOffset : float

The position of the axis title on the axis. The value must be between `-1.0f` and `1.0f`

Access functions:

float | titleOffset() const
void | setTitleOffset(float offset)

Notifier signal:

void | titleOffsetChanged(float offset)

See also title and titleFixed.

### titleVisible : bool

This property holds whether the axis title is visible in the primary graph view.

The default value is `false`.

Access functions:

bool | isTitleVisible() const
void | setTitleVisible(bool visible)

Notifier signal:

void | titleVisibleChanged(bool visible)

See also title and titleFixed.

### `[read-only]` type : const QAbstract3DAxis::AxisType

This property holds the type of the axis.

The value is one of AxisType values.

Access functions:

QAbstract3DAxis::AxisType | type() const

## Member Function Documentation

### `[override virtual noexcept]` QAbstract3DAxis::~QAbstract3DAxis()

Destroys QAbstract3DAxis.

### `[signal]` void QAbstract3DAxis::rangeChanged(float min, float max)

Emits the minimum and maximum values of the range, min and max, when the range changes.

### void QAbstract3DAxis::setRange(float min, float max)

Sets the value range of the axis from min to max. When setting the range, the maximum value is adjusted if necessary, to ensure that the range remains valid.

Note: For QCategory3DAxis, specifies the index range of rows or columns to show.