diff options
author | Michal Klocek <Michal.Klocek@digia.com> | 2012-11-29 17:10:08 +0200 |
---|---|---|
committer | Michal Klocek <Michal.Klocek@digia.com> | 2012-11-29 17:10:18 +0200 |
commit | d7155d151d730b179b4ebb02aa5144f07973bed5 (patch) | |
tree | 9e13abd2de8bf7a86361971b7358bf4f957c5a95 /src/axis/valueaxis/qvalueaxis.cpp | |
parent | 611d357cfff4444c5cceb1acc93a7b9c75727f31 (diff) |
Add docs for nice number algorithm
Diffstat (limited to 'src/axis/valueaxis/qvalueaxis.cpp')
-rw-r--r-- | src/axis/valueaxis/qvalueaxis.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/axis/valueaxis/qvalueaxis.cpp b/src/axis/valueaxis/qvalueaxis.cpp index 17bca869..2a0508b0 100644 --- a/src/axis/valueaxis/qvalueaxis.cpp +++ b/src/axis/valueaxis/qvalueaxis.cpp @@ -153,12 +153,14 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE /*! \property QValueAxis::niceNumbersEnabled - Whether the nice numbers algorithm is enabled or not for the axis. + \obsolete + Using this function can lead to unexpected behavior. Use applyNiceNumbers() instead. */ /*! \qmlproperty bool ValueAxis::niceNumbersEnabled - Whether the nice numbers algorithm is enabled or not for the axis. + \obsolete + Using this function can lead to unexpected behavior. Use applyNiceNumbers() instead. */ /*! @@ -241,7 +243,7 @@ int QValueAxis::tickCount() const void QValueAxis::setNiceNumbersEnabled(bool enable) { Q_D(QValueAxis); - qWarning()<<"This function is depreciated, it can lead to unexpected behaviour.Use applyNiceNumbers(). "; + qWarning()<<"This function is depreciated, it can lead to unexpected behavior.Use applyNiceNumbers(). "; if(enable) { QObject::connect(this,SIGNAL(rangeChanged(qreal,qreal)),this,SLOT(applyNiceNumbers())); QObject::connect(this,SIGNAL(tickCountChanged(int)),this,SLOT(applyNiceNumbers())); @@ -282,6 +284,12 @@ QAbstractAxis::AxisType QValueAxis::type() const return AxisTypeValue; } +/*! + This method modifies range and number of ticks on the axis to look "nice". Algorithm considers numbers that + can be expressed as form of 1*10^n, 2* 10^n or 5*10^n as a nice numbers. These numbers are used for spacing the ticks. + This method will modify the current range and number of ticks. + \sa setRange(), setTicks() +*/ void QValueAxis::applyNiceNumbers() { Q_D(QValueAxis); |