diff --git a/doc/src/qml.qdoc b/doc/src/qml.qdoc index a6716a6..355a321 100644 --- a/doc/src/qml.qdoc +++ b/doc/src/qml.qdoc @@ -36,6 +36,7 @@
  • PolarChartView
  • AbstractAxis
  • ValueAxis
  • +
  • LogValueAxis
  • CategoryAxis
  • CategoryRange
  • BarCategoryAxis
  • diff --git a/plugins/declarative/declarativechart.cpp b/plugins/declarative/declarativechart.cpp index c81bbdc..5910979 100644 --- a/plugins/declarative/declarativechart.cpp +++ b/plugins/declarative/declarativechart.cpp @@ -28,6 +28,7 @@ #include "declarativescatterseries.h" #include "qbarcategoryaxis.h" #include "qvalueaxis.h" +#include "qlogvalueaxis.h" #include "qcategoryaxis.h" #include "qabstractseries_p.h" #include "declarativemargins.h" @@ -762,6 +763,8 @@ QAbstractAxis *DeclarativeChart::defaultAxis(Qt::Orientation orientation, QAbstr case QAbstractAxis::AxisTypeDateTime: return new QDateTimeAxis(this); #endif + case QAbstractAxis::AxisTypeLogValue: + return new QLogValueAxis(this); default: // assume AxisTypeNoAxis return 0; diff --git a/plugins/declarative/plugin.cpp b/plugins/declarative/plugin.cpp index dd06021..0b3a59f 100644 --- a/plugins/declarative/plugin.cpp +++ b/plugins/declarative/plugin.cpp @@ -21,6 +21,7 @@ #include "qchart.h" #include "qabstractaxis.h" #include "qvalueaxis.h" +#include "qlogvalueaxis.h" #include "declarativecategoryaxis.h" #include "qbarcategoryaxis.h" #include "declarativechart.h" @@ -83,6 +84,7 @@ Q_DECLARE_METATYPE(QValueAxis *) Q_DECLARE_METATYPE(QBarCategoryAxis *) Q_DECLARE_METATYPE(QCategoryAxis *) Q_DECLARE_METATYPE(QDateTimeAxis *) +Q_DECLARE_METATYPE(QLogValueAxis *) Q_DECLARE_METATYPE(QLegend *) Q_DECLARE_METATYPE(QLegendMarker *) @@ -232,6 +234,7 @@ public: qmlRegisterType(uri, 1, 3, "ScatterSeries"); qmlRegisterType(uri, 1, 3, "LineSeries"); qmlRegisterType(uri, 1, 3, "AreaSeries"); + qmlRegisterType(uri, 1, 3, "LogValueAxis"); } }; diff --git a/src/axis/logvalueaxis/qlogvalueaxis.cpp b/src/axis/logvalueaxis/qlogvalueaxis.cpp index 27896b5..b948559 100644 --- a/src/axis/logvalueaxis/qlogvalueaxis.cpp +++ b/src/axis/logvalueaxis/qlogvalueaxis.cpp @@ -41,23 +41,52 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE */ /*! + \qmlclass LogValuesAxis QLogValueAxis + \brief The LogValueAxis element is used for manipulating chart's axes + \inherits AbstractAxis + + \note If a LogValueAxis is attached to a series with one or more points with + negative or zero values on the associated dimension, the series will not be + plotted at all. This is particularly relevant when XYModelMappers are used, + since empty cells in models typically contain zero values. +*/ + +/*! \property QLogValueAxis::min Defines the minimum value on the axis. When setting this property the max is adjusted if necessary, to ensure that the range remains valid. - Value has to be greater then 0. + Value has to be greater than 0. +*/ +/*! + \qmlproperty real LogValuesAxis::min + Defines the minimum value on the axis. + When setting this property the max is adjusted if necessary, to ensure that the range remains valid. + Value has to be greater than 0. */ /*! \property QLogValueAxis::max Defines the maximum value on the axis. When setting this property the min is adjusted if necessary, to ensure that the range remains valid. - Value has to be greater then 0. + Value has to be greater than 0. +*/ +/*! + \qmlproperty real LogValuesAxis::max + Defines the maximum value on the axis. + When setting this property the min is adjusted if necessary, to ensure that the range remains valid. + Value has to be greater than 0. */ /*! \property QLogValueAxis::base Defines the base of the logarithm. - Value has to be greater then 0 and not equal 1 + Value has to be greater than 0 and not equal 1 +*/ +/*! + \qmlproperty real LogValuesAxis::base + Defines the maximum value on the axis. + Defines the base of the logarithm. + Value has to be greater than 0 and not equal 1 */ /*! @@ -66,16 +95,30 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE Supported specifiers are: d, i, o, x, X, f, F, e, E, g, G, c See QString::sprintf() for additional details. */ +/*! + \qmlproperty real LogValuesAxis::labelFormat + Defines the label format of the axis. + Supported specifiers are: d, i, o, x, X, f, F, e, E, g, G, c + See QString::sprintf() for additional details. +*/ /*! \fn void QLogValueAxis::minChanged(qreal min) Axis emits signal when \a min of axis has changed. */ +/*! + \qmlsignal LogValuesAxis::onMinChanged(qreal min) + Axis emits signal when \a min of axis has changed. +*/ /*! \fn void QLogValueAxis::maxChanged(qreal max) Axis emits signal when \a max of axis has changed. */ +/*! + \qmlsignal LogValuesAxis::onMaxChanged(qreal max) + Axis emits signal when \a max of axis has changed. +*/ /*! \fn void QLogValueAxis::rangeChanged(qreal min, qreal max) @@ -86,11 +129,19 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE \fn void QLogValueAxis::labelFormatChanged(const QString &format) Axis emits signal when \a format of axis labels has changed. */ +/*! + \qmlsignal LogValueAxis::labelFormatChanged(const QString &format) + Axis emits signal when \a format of axis labels has changed. +*/ /*! \fn void QLogValueAxis::baseChanged(qreal base) Axis emits signal when \a base of logarithm of the axis has changed. */ +/*! + \qmlsignal LogValuesAxis::baseChanged(qreal base) + Axis emits signal when \a base of logarithm of the axis has changed. +*/ /*! Constructs an axis object which is a child of \a parent.