@@ -28,13 +28,26 | |||||
28 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
28 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
29 | /*! |
|
29 | /*! | |
30 | \class QCategoryAxis |
|
30 | \class QCategoryAxis | |
31 |
\brief The QCategoryAxis class |
|
31 | \brief The QCategoryAxis class allows putting a named ranges on the axis. | |
32 | \mainclass |
|
32 | \mainclass | |
|
33 | ||||
|
34 | This class can be used when the underlying data needs to be given extra meaning. | |||
|
35 | Unlike with the QBarCategoryAxis the QCategoryAxis allows the categories ranges widths to be specified freely. | |||
33 | */ |
|
36 | */ | |
34 |
|
37 | |||
35 | /*! |
|
38 | /*! | |
36 | \qmlclass CategoryAxis QCategoryAxis |
|
39 | \qmlclass CategoryAxis QCategoryAxis | |
37 | \brief The Axis element is used for manipulating chart's axes. |
|
40 | \brief The QCategoryAxis class allows putting a named ranges on the axis. | |
|
41 | */ | |||
|
42 | ||||
|
43 | /*! | |||
|
44 | \property QCategoryAxis::startValue | |||
|
45 | Defines the low end of the first category on the axis. | |||
|
46 | */ | |||
|
47 | ||||
|
48 | /*! | |||
|
49 | \qmlproperty int CategoryAxis::startValue | |||
|
50 | Defines the low end of the first category on the axis. | |||
38 | */ |
|
51 | */ | |
39 |
|
52 | |||
40 | /*! |
|
53 | /*! | |
@@ -90,7 +103,16 void QCategoryAxis::append(const QString& categoryLabel, qreal categoryHighEnd) | |||||
90 | } |
|
103 | } | |
91 |
|
104 | |||
92 | /*! |
|
105 | /*! | |
93 |
|
|
106 | Returns the low end limit of the first category on the axis. | |
|
107 | */ | |||
|
108 | qreal QCategoryAxis::startValue() const | |||
|
109 | { | |||
|
110 | Q_D(const QCategoryAxis); | |||
|
111 | return d->m_categoryMinimum; | |||
|
112 | } | |||
|
113 | ||||
|
114 | /*! | |||
|
115 | Sets \a min to be the low end limit of the first category on the axis. | |||
94 | */ |
|
116 | */ | |
95 | void QCategoryAxis::setStartValue(qreal min) |
|
117 | void QCategoryAxis::setStartValue(qreal min) | |
96 | { |
|
118 | { |
@@ -31,6 +31,7 class QCategoryAxisPrivate; | |||||
31 | class QTCOMMERCIALCHART_EXPORT QCategoryAxis : public QValueAxis |
|
31 | class QTCOMMERCIALCHART_EXPORT QCategoryAxis : public QValueAxis | |
32 | { |
|
32 | { | |
33 | Q_OBJECT |
|
33 | Q_OBJECT | |
|
34 | Q_PROPERTY(qreal startValue READ startValue WRITE setStartValue) | |||
34 |
|
35 | |||
35 | public: |
|
36 | public: | |
36 | explicit QCategoryAxis(QObject *parent = 0); |
|
37 | explicit QCategoryAxis(QObject *parent = 0); | |
@@ -46,6 +47,7 public: | |||||
46 | void remove(const QString& label); |
|
47 | void remove(const QString& label); | |
47 | void replaceLabel(const QString& oldLabel, const QString& newLabel); |
|
48 | void replaceLabel(const QString& oldLabel, const QString& newLabel); | |
48 |
|
49 | |||
|
50 | qreal startValue() const; | |||
49 | void setStartValue(qreal min); |
|
51 | void setStartValue(qreal min); | |
50 |
|
52 | |||
51 | qreal categoryStart(const QString& categoryLabel) const; |
|
53 | qreal categoryStart(const QString& categoryLabel) const; | |
@@ -54,7 +56,6 public: | |||||
54 | QStringList categoriesLabels(); |
|
56 | QStringList categoriesLabels(); | |
55 | int count() const; |
|
57 | int count() const; | |
56 |
|
58 | |||
57 |
|
||||
58 | private: |
|
59 | private: | |
59 | Q_DECLARE_PRIVATE(QCategoryAxis) |
|
60 | Q_DECLARE_PRIVATE(QCategoryAxis) | |
60 | Q_DISABLE_COPY(QCategoryAxis) |
|
61 | Q_DISABLE_COPY(QCategoryAxis) |
@@ -45,8 +45,6 public: | |||||
45 | QCategoryAxisPrivate(QCategoryAxis *q); |
|
45 | QCategoryAxisPrivate(QCategoryAxis *q); | |
46 | ~QCategoryAxisPrivate(); |
|
46 | ~QCategoryAxisPrivate(); | |
47 |
|
47 | |||
48 |
|
||||
49 | public: |
|
|||
50 | ChartAxis* createGraphics(ChartPresenter* presenter); |
|
48 | ChartAxis* createGraphics(ChartPresenter* presenter); | |
51 | int ticksCount() const; |
|
49 | int ticksCount() const; | |
52 |
|
50 |
@@ -33,7 +33,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE | |||||
33 | \mainclass |
|
33 | \mainclass | |
34 |
|
34 | |||
35 | The labels can be configured by setting an appropriate DateTime format. |
|
35 | The labels can be configured by setting an appropriate DateTime format. | |
36 |
Note that any date before 4 |
|
36 | Note that any date before 4714 BCE or after about 1.4 million CE may not be accurately stored. | |
37 | QDateTimeAxis can be setup to show axis line with tick marks, grid lines and shades. |
|
37 | QDateTimeAxis can be setup to show axis line with tick marks, grid lines and shades. | |
38 | */ |
|
38 | */ | |
39 |
|
39 | |||
@@ -42,7 +42,7 QTCOMMERCIALCHART_BEGIN_NAMESPACE | |||||
42 | \brief The DateTimeAxis element is used for manipulating chart's axes |
|
42 | \brief The DateTimeAxis element is used for manipulating chart's axes | |
43 |
|
43 | |||
44 | The labels can be configured by setting an appropriate DateTime format. |
|
44 | The labels can be configured by setting an appropriate DateTime format. | |
45 |
Note that any date before 4 |
|
45 | Note that any date before 4714 BCE or after about 1.4 million CE may not be accurately stored. | |
46 | DateTimeAxis can be setup to show axis line with tick marks, grid lines and shades. |
|
46 | DateTimeAxis can be setup to show axis line with tick marks, grid lines and shades. | |
47 | */ |
|
47 | */ | |
48 |
|
48 | |||
@@ -175,8 +175,6 void QDateTimeAxis::setRange(QDateTime min, QDateTime max) | |||||
175 | emit maxChanged(max); |
|
175 | emit maxChanged(max); | |
176 | } |
|
176 | } | |
177 |
|
177 | |||
178 | // if(d->m_niceNumbers) d->looseNiceNumbers(d->m_min, d->m_max, d->m_tickCount); |
|
|||
179 |
|
||||
180 | if (changed) { |
|
178 | if (changed) { | |
181 | emit rangeChanged(d->m_min,d->m_max); |
|
179 | emit rangeChanged(d->m_min,d->m_max); | |
182 | d->emitUpdated(); |
|
180 | d->emitUpdated(); |
General Comments 0
You need to be logged in to leave comments.
Login now