diff options
author | Marek Rosa <marek.rosa@digia.com> | 2012-09-05 11:25:22 +0300 |
---|---|---|
committer | Marek Rosa <marek.rosa@digia.com> | 2012-09-05 11:26:18 +0300 |
commit | 2d1e68a175567699a36346838025649e0dc3125d (patch) | |
tree | 1ca0de753d4e918c3b3847b3d3f376bef28a6562 | |
parent | 1eee26773b871774e83dc84ad92359381f0c37d7 (diff) |
QDateTimeAxis docs updated
-rw-r--r-- | src/axis/datetimeaxis/qdatetimeaxis.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/axis/datetimeaxis/qdatetimeaxis.cpp b/src/axis/datetimeaxis/qdatetimeaxis.cpp index 1712024f..60f96b54 100644 --- a/src/axis/datetimeaxis/qdatetimeaxis.cpp +++ b/src/axis/datetimeaxis/qdatetimeaxis.cpp @@ -24,7 +24,6 @@ #include "chartdatetimeaxisy_p.h" #include "domain_p.h" #include <cmath> -#include <QDebug> QTCOMMERCIALCHART_BEGIN_NAMESPACE /*! @@ -34,24 +33,33 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE The labels can be configured by setting an appropriate DateTime format. QDateTimeAxis works correctly with dates from 4714 BCE to 287396 CE - There are also other limitiation that are specified in QDateTime documentation. Please refer to it. + There are also other limitiation related to QDateTime . Please refer to QDateTime documentation. QDateTimeAxis can be setup to show axis line with tick marks, grid lines and shades. + NOTE: QDateTimeAxis is disabled on ARM platform at the present time. + \image api_datatime_axis.png - Example code on how to use QDateTimeAxis. + QDateTimeAxis can be used with QLineSeries, QSplineSeries or QScatterSeries. + To add a data point to the series QDateTime::toMSecsSinceEpoch() is used. \code - QChartView *chartView = new QChartView; QLineSeries *series = new QLineSeries; QDateTime xValue; xValue.setDate(QDate(2012, 1 , 18)); xValue.setTime(QTime(9, 34)); - series->append(xValue.toMSecsSinceEpoch(), 12); + qreal yValue = 12; + series->append(xValue.toMSecsSinceEpoch(), yValue); xValue.setDate(QDate(2013, 5 , 11)); xValue.setTime(QTime(11, 14)); - series->append(xValue.toMSecsSinceEpoch(), 22); + qreal yValue = 22; + series->append(xValue.toMSecsSinceEpoch(), yValue); + \endcode + + Adding the series to the chart and setting up the QDateTimeAxis. + \code + QChartView *chartView = new QChartView; chartView->chart()->addSeries(series); // ... |