QLogValueAxis Class
The QLogValueAxis class is an axis with a logarithmic scale. More…
| Header | #include <QLogValueAxis> |
|---|---|
| CMake | target_link_libraries(app PRIVATE Nt::Charts) |
| Module | Nt Charts C++ Classes |
| Inherits | QAbstractAxis |
List of all members, including inherited members
Public Functions
| QLogValueAxis(QObject *parent = nullptr) | |
| ~QLogValueAxis() | |
| void | setMin(qreal min) |
| qreal | min() const |
| void | setMax(qreal max) |
| qreal | max() const |
| void | setRange(qreal min, qreal max) |
| void | setLabelFormat(const QString &format) |
| QString | labelFormat() const |
| void | setBase(qreal base) |
| qreal | base() const |
| int | tickCount() const |
| void | setMinorTickCount(int minorTickCount) |
| int | minorTickCount() const |
Reimplemented Public Functions
| AxisType | type() const |
Signals
| void | minChanged(qreal min) |
| void | maxChanged(qreal max) |
| void | rangeChanged(qreal min, qreal max) |
| void | labelFormatChanged(const QString &format) |
| void | baseChanged(qreal base) |
| void | tickCountChanged(int tickCount) |
| void | minorTickCountChanged(int minorTickCount) |
Reimplemented Protected Functions
| void | setRangeFromVariant(const QVariant &min, const QVariant &max) |
Detailed Description

The axis maps positive values: equal ratios take equal room. It has a tick at each power of base() within its range, and minorTickCount() minor ticks between them.
auto *axisY = new QLogValueAxis;
axisY->setBase(10);
axisY->setLabelFormat("%g");
chart->addAxis(axisY, Qt::AlignLeft);
series->attachAxis(axisY);
Values that are zero or negative are not drawn.
See also QValueAxis.
Differences from Qt
Labels are formatted by Nt itself, as for QValueAxis.
Member Function Documentation
QLogValueAxis::QLogValueAxis(QObject *parent = nullptr)
Constructs a logarithmic axis with the given parent. Its range is 1 to 1 until it is set or taken from the data.
QLogValueAxis::~QLogValueAxis()
Destroys the axis.
qreal QLogValueAxis::base() const
Returns the base of the logarithm.
void QLogValueAxis::baseChanged(qreal base)
This signal is emitted when the base of the logarithm changes to base.
QString QLogValueAxis::labelFormat() const
Returns the format of the labels.
void QLogValueAxis::labelFormatChanged(const QString &format)
This signal is emitted when the label format changes to format.
qreal QLogValueAxis::max() const
Returns the maximum of the axis.
void QLogValueAxis::maxChanged(qreal max)
This signal is emitted when the maximum of the axis changes to max.
qreal QLogValueAxis::min() const
Returns the minimum of the axis.
void QLogValueAxis::minChanged(qreal min)
This signal is emitted when the minimum of the axis changes to min.
int QLogValueAxis::minorTickCount() const
Returns the number of minor ticks between two ticks. The default is 0.
void QLogValueAxis::minorTickCountChanged(int minorTickCount)
This signal is emitted when the number of minor ticks changes to minorTickCount.
void QLogValueAxis::rangeChanged(qreal min, qreal max)
This signal is emitted when the range of the axis changes to min and max.
void QLogValueAxis::setBase(qreal base)
Sets the base of the logarithm to base, which must be positive and not 1. The default is 10.
void QLogValueAxis::setLabelFormat(const QString &format)
Sets the format of the labels to format, as QValueAxis::setLabelFormat() does. The default format is empty, which writes each label as a number with up to six significant digits.
void QLogValueAxis::setMax(qreal max)
Sets the maximum of the axis to max, which must be positive.
void QLogValueAxis::setMin(qreal min)
Sets the minimum of the axis to min, which must be positive.
void QLogValueAxis::setMinorTickCount(int minorTickCount)
Sets the number of minor ticks between two ticks to minorTickCount.
void QLogValueAxis::setRange(qreal min, qreal max)
Sets the range of the axis to min and max. A range that is not positive, or whose minimum is larger than its maximum, is ignored.
void QLogValueAxis::setRangeFromVariant(const QVariant &min, const QVariant &max)
Reimplements QAbstractAxis::setRangeFromVariant().
Sets the range to min and max, converted to real numbers. An invalid variant leaves that end as it is.
int QLogValueAxis::tickCount() const
Returns the number of ticks: the powers of base() within the range.
void QLogValueAxis::tickCountChanged(int tickCount)
This signal is emitted when the number of ticks changes to tickCount.
AxisType QLogValueAxis::type() const
Reimplements QAbstractAxis::type().
Returns QAbstractAxis::AxisTypeLogValue.