@@ -34,7 +34,7 | |||||
34 | <li><a href="qabstractaxis.html">QAbstractAxis</a></li> |
|
34 | <li><a href="qabstractaxis.html">QAbstractAxis</a></li> | |
35 | <li><a href="qvalueaxis.html">QValueAxis</a></li> |
|
35 | <li><a href="qvalueaxis.html">QValueAxis</a></li> | |
36 | <li><a href="qbarcategoryaxis.html">QBarCategoryAxis</a></li> |
|
36 | <li><a href="qbarcategoryaxis.html">QBarCategoryAxis</a></li> | |
37 |
<li><a href="q |
|
37 | <li><a href="qcategoryaxis.html">QCategoryAxis</a></li> | |
38 | <li><a href="qlegend.html">QLegend</a></li> |
|
38 | <li><a href="qlegend.html">QLegend</a></li> | |
39 | <li><a href="qabstractseries.html">QAbstractSeries</a></li> |
|
39 | <li><a href="qabstractseries.html">QAbstractSeries</a></li> | |
40 | <li><a href="qchartglobal.html">QChartGlobal</a></li> |
|
40 | <li><a href="qchartglobal.html">QChartGlobal</a></li> |
@@ -3,13 +3,13 | |||||
3 | INCLUDEPATH += $$PWD \ |
|
3 | INCLUDEPATH += $$PWD \ | |
4 | $$PWD/valueaxis \ |
|
4 | $$PWD/valueaxis \ | |
5 | $$PWD/barcategoryaxis \ |
|
5 | $$PWD/barcategoryaxis \ | |
6 |
$$PWD/ |
|
6 | $$PWD/categoryaxis \ | |
7 | $$PWD/datetimeaxis |
|
7 | $$PWD/datetimeaxis | |
8 |
|
8 | |||
9 | DEPENDPATH += $$PWD \ |
|
9 | DEPENDPATH += $$PWD \ | |
10 | $$PWD/valueaxis \ |
|
10 | $$PWD/valueaxis \ | |
11 | $$PWD/barcategoryaxis \ |
|
11 | $$PWD/barcategoryaxis \ | |
12 |
$$PWD/ |
|
12 | $$PWD/categoryaxis \ | |
13 | $$PWD/datetimeaxis |
|
13 | $$PWD/datetimeaxis | |
14 |
|
14 | |||
15 | SOURCES += \ |
|
15 | SOURCES += \ | |
@@ -21,9 +21,9 SOURCES += \ | |||||
21 | $$PWD/barcategoryaxis/chartbarcategoryaxisx.cpp \ |
|
21 | $$PWD/barcategoryaxis/chartbarcategoryaxisx.cpp \ | |
22 | $$PWD/barcategoryaxis/chartbarcategoryaxisy.cpp \ |
|
22 | $$PWD/barcategoryaxis/chartbarcategoryaxisy.cpp \ | |
23 | $$PWD/barcategoryaxis/qbarcategoryaxis.cpp \ |
|
23 | $$PWD/barcategoryaxis/qbarcategoryaxis.cpp \ | |
24 |
$$PWD/ |
|
24 | $$PWD/categoryaxis/chartcategoryaxisx.cpp \ | |
25 |
$$PWD/ |
|
25 | $$PWD/categoryaxis/chartcategoryaxisy.cpp \ | |
26 |
$$PWD/ |
|
26 | $$PWD/categoryaxis/qcategoryaxis.cpp \ | |
27 | $$PWD/datetimeaxis/chartdatetimeaxisx.cpp \ |
|
27 | $$PWD/datetimeaxis/chartdatetimeaxisx.cpp \ | |
28 | $$PWD/datetimeaxis/chartdatetimeaxisy.cpp \ |
|
28 | $$PWD/datetimeaxis/chartdatetimeaxisy.cpp \ | |
29 | $$PWD/datetimeaxis/qdatetimeaxis.cpp |
|
29 | $$PWD/datetimeaxis/qdatetimeaxis.cpp | |
@@ -37,9 +37,9 PRIVATE_HEADERS += \ | |||||
37 | $$PWD/barcategoryaxis/chartbarcategoryaxisx_p.h \ |
|
37 | $$PWD/barcategoryaxis/chartbarcategoryaxisx_p.h \ | |
38 | $$PWD/barcategoryaxis/chartbarcategoryaxisy_p.h \ |
|
38 | $$PWD/barcategoryaxis/chartbarcategoryaxisy_p.h \ | |
39 | $$PWD/barcategoryaxis/qbarcategoryaxis_p.h \ |
|
39 | $$PWD/barcategoryaxis/qbarcategoryaxis_p.h \ | |
40 |
$$PWD/ |
|
40 | $$PWD/categoryaxis/chartcategoryaxisx_p.h \ | |
41 |
$$PWD/ |
|
41 | $$PWD/categoryaxis/chartcategoryaxisy_p.h \ | |
42 |
$$PWD/ |
|
42 | $$PWD/categoryaxis/qcategoryaxis_p.h \ | |
43 | $$PWD/datetimeaxis/chartdatetimeaxisx_p.h \ |
|
43 | $$PWD/datetimeaxis/chartdatetimeaxisx_p.h \ | |
44 | $$PWD/datetimeaxis/chartdatetimeaxisy_p.h \ |
|
44 | $$PWD/datetimeaxis/chartdatetimeaxisy_p.h \ | |
45 | $$PWD/datetimeaxis/qdatetimeaxis_p.h |
|
45 | $$PWD/datetimeaxis/qdatetimeaxis_p.h | |
@@ -48,5 +48,5 PUBLIC_HEADERS += \ | |||||
48 | $$PWD/qabstractaxis.h \ |
|
48 | $$PWD/qabstractaxis.h \ | |
49 | $$PWD/valueaxis/qvalueaxis.h \ |
|
49 | $$PWD/valueaxis/qvalueaxis.h \ | |
50 | $$PWD/barcategoryaxis/qbarcategoryaxis.h \ |
|
50 | $$PWD/barcategoryaxis/qbarcategoryaxis.h \ | |
51 |
$$PWD/ |
|
51 | $$PWD/categoryaxis/qcategoryaxis.h \ | |
52 | $$PWD/datetimeaxis/qdatetimeaxis.h |
|
52 | $$PWD/datetimeaxis/qdatetimeaxis.h |
@@ -18,8 +18,8 | |||||
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 |
#include "chart |
|
21 | #include "chartcategoryaxisx_p.h" | |
22 |
#include "q |
|
22 | #include "qcategoryaxis.h" | |
23 | #include "qabstractaxis.h" |
|
23 | #include "qabstractaxis.h" | |
24 | #include "chartpresenter_p.h" |
|
24 | #include "chartpresenter_p.h" | |
25 | #include <QGraphicsLayout> |
|
25 | #include <QGraphicsLayout> | |
@@ -30,15 +30,15 static int label_padding = 5; | |||||
30 |
|
30 | |||
31 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
31 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
32 |
|
32 | |||
33 |
Chart |
|
33 | ChartCategoryAxisX::ChartCategoryAxisX(QAbstractAxis *axis,ChartPresenter *presenter) : ChartAxis(axis,presenter) | |
34 | { |
|
34 | { | |
35 | } |
|
35 | } | |
36 |
|
36 | |||
37 |
Chart |
|
37 | ChartCategoryAxisX::~ChartCategoryAxisX() | |
38 | { |
|
38 | { | |
39 | } |
|
39 | } | |
40 |
|
40 | |||
41 |
QVector<qreal> Chart |
|
41 | QVector<qreal> ChartCategoryAxisX::calculateLayout() const | |
42 | { |
|
42 | { | |
43 | QCategoryAxis *axis = qobject_cast<QCategoryAxis *>(m_chartAxis); |
|
43 | QCategoryAxis *axis = qobject_cast<QCategoryAxis *>(m_chartAxis); | |
44 | int tickCount = axis->intervalsLabels().count() + 1; |
|
44 | int tickCount = axis->intervalsLabels().count() + 1; | |
@@ -62,7 +62,7 QVector<qreal> ChartIntervalAxisX::calculateLayout() const | |||||
62 | return points; |
|
62 | return points; | |
63 | } |
|
63 | } | |
64 |
|
64 | |||
65 |
void Chart |
|
65 | void ChartCategoryAxisX::updateGeometry() | |
66 | { |
|
66 | { | |
67 | const QVector<qreal>& layout = ChartAxis::layout(); |
|
67 | const QVector<qreal>& layout = ChartAxis::layout(); | |
68 |
|
68 | |||
@@ -121,7 +121,7 void ChartIntervalAxisX::updateGeometry() | |||||
121 | } |
|
121 | } | |
122 | } |
|
122 | } | |
123 |
|
123 | |||
124 |
void Chart |
|
124 | void ChartCategoryAxisX::handleAxisUpdated() | |
125 | { |
|
125 | { | |
126 | updateGeometry(); |
|
126 | updateGeometry(); | |
127 | ChartAxis::handleAxisUpdated(); |
|
127 | ChartAxis::handleAxisUpdated(); |
@@ -37,11 +37,11 QTCOMMERCIALCHART_BEGIN_NAMESPACE | |||||
37 | class QAbstractAxis; |
|
37 | class QAbstractAxis; | |
38 | class ChartPresenter; |
|
38 | class ChartPresenter; | |
39 |
|
39 | |||
40 |
class Chart |
|
40 | class ChartCategoryAxisX : public ChartAxis | |
41 | { |
|
41 | { | |
42 | public: |
|
42 | public: | |
43 |
Chart |
|
43 | ChartCategoryAxisX(QAbstractAxis *axis, ChartPresenter *presenter); | |
44 |
~Chart |
|
44 | ~ChartCategoryAxisX(); | |
45 |
|
45 | |||
46 | AxisType axisType() const { return X_AXIS;} |
|
46 | AxisType axisType() const { return X_AXIS;} | |
47 |
|
47 |
@@ -18,8 +18,8 | |||||
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 |
#include "chart |
|
21 | #include "chartcategoryaxisy_p.h" | |
22 |
#include "q |
|
22 | #include "qcategoryaxis.h" | |
23 | #include "qabstractaxis.h" |
|
23 | #include "qabstractaxis.h" | |
24 | #include "chartpresenter_p.h" |
|
24 | #include "chartpresenter_p.h" | |
25 | #include <QGraphicsLayout> |
|
25 | #include <QGraphicsLayout> | |
@@ -31,15 +31,15 static int label_padding = 5; | |||||
31 |
|
31 | |||
32 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
32 | QTCOMMERCIALCHART_BEGIN_NAMESPACE | |
33 |
|
33 | |||
34 |
Chart |
|
34 | ChartCategoryAxisY::ChartCategoryAxisY(QAbstractAxis *axis,ChartPresenter *presenter) : ChartAxis(axis,presenter) | |
35 | { |
|
35 | { | |
36 | } |
|
36 | } | |
37 |
|
37 | |||
38 |
Chart |
|
38 | ChartCategoryAxisY::~ChartCategoryAxisY() | |
39 | { |
|
39 | { | |
40 | } |
|
40 | } | |
41 |
|
41 | |||
42 |
QVector<qreal> Chart |
|
42 | QVector<qreal> ChartCategoryAxisY::calculateLayout() const | |
43 | { |
|
43 | { | |
44 | QCategoryAxis *axis = qobject_cast<QCategoryAxis *>(m_chartAxis); |
|
44 | QCategoryAxis *axis = qobject_cast<QCategoryAxis *>(m_chartAxis); | |
45 | int tickCount = axis->intervalsLabels().count() + 1; |
|
45 | int tickCount = axis->intervalsLabels().count() + 1; | |
@@ -63,7 +63,7 QVector<qreal> ChartIntervalAxisY::calculateLayout() const | |||||
63 | return points; |
|
63 | return points; | |
64 | } |
|
64 | } | |
65 |
|
65 | |||
66 |
void Chart |
|
66 | void ChartCategoryAxisY::updateGeometry() | |
67 | { |
|
67 | { | |
68 | const QVector<qreal> &layout = ChartAxis::layout(); |
|
68 | const QVector<qreal> &layout = ChartAxis::layout(); | |
69 | m_minWidth = 0; |
|
69 | m_minWidth = 0; | |
@@ -128,7 +128,7 void ChartIntervalAxisY::updateGeometry() | |||||
128 | } |
|
128 | } | |
129 | } |
|
129 | } | |
130 |
|
130 | |||
131 |
void Chart |
|
131 | void ChartCategoryAxisY::handleAxisUpdated() | |
132 | { |
|
132 | { | |
133 | updateGeometry(); |
|
133 | updateGeometry(); | |
134 | ChartAxis::handleAxisUpdated(); |
|
134 | ChartAxis::handleAxisUpdated(); |
@@ -37,11 +37,11 QTCOMMERCIALCHART_BEGIN_NAMESPACE | |||||
37 | class QAbstractAxis; |
|
37 | class QAbstractAxis; | |
38 | class ChartPresenter; |
|
38 | class ChartPresenter; | |
39 |
|
39 | |||
40 |
class Chart |
|
40 | class ChartCategoryAxisY : public ChartAxis | |
41 | { |
|
41 | { | |
42 | public: |
|
42 | public: | |
43 |
Chart |
|
43 | ChartCategoryAxisY(QAbstractAxis *axis, ChartPresenter *presenter); | |
44 |
~Chart |
|
44 | ~ChartCategoryAxisY(); | |
45 |
|
45 | |||
46 | AxisType axisType() const { return Y_AXIS;} |
|
46 | AxisType axisType() const { return Y_AXIS;} | |
47 |
|
47 |
@@ -18,10 +18,10 | |||||
18 | ** |
|
18 | ** | |
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 |
#include "q |
|
21 | #include "qcategoryaxis.h" | |
22 |
#include "q |
|
22 | #include "qcategoryaxis_p.h" | |
23 |
#include "chart |
|
23 | #include "chartcategoryaxisx_p.h" | |
24 |
#include "chart |
|
24 | #include "chartcategoryaxisy_p.h" | |
25 | #include <qmath.h> |
|
25 | #include <qmath.h> | |
26 | #include <QDebug> |
|
26 | #include <QDebug> | |
27 |
|
27 | |||
@@ -33,15 +33,8 QTCOMMERCIALCHART_BEGIN_NAMESPACE | |||||
33 | */ |
|
33 | */ | |
34 |
|
34 | |||
35 | /*! |
|
35 | /*! | |
36 | \qmlclass Axis QCategoryAxis |
|
36 | \qmlclass CategoryAxis QCategoryAxis | |
37 | \brief The Axis element is used for manipulating chart's axes. |
|
37 | \brief The Axis element is used for manipulating chart's axes. | |
38 |
|
||||
39 | Axis can be setup to show axis line with tick marks, grid lines and shades. |
|
|||
40 |
|
||||
41 | To access Axes you can use ChartView API. For example: |
|
|||
42 | \code |
|
|||
43 | // TODO :) |
|
|||
44 | \endcode |
|
|||
45 | */ |
|
38 | */ | |
46 |
|
39 | |||
47 | /*! |
|
40 | /*! | |
@@ -237,13 +230,13 ChartAxis* QCategoryAxisPrivate::createGraphics(ChartPresenter* presenter) | |||||
237 | { |
|
230 | { | |
238 | Q_Q(QCategoryAxis); |
|
231 | Q_Q(QCategoryAxis); | |
239 | if(m_orientation == Qt::Vertical){ |
|
232 | if(m_orientation == Qt::Vertical){ | |
240 |
return new Chart |
|
233 | return new ChartCategoryAxisY(q,presenter); | |
241 | }else{ |
|
234 | }else{ | |
242 |
return new Chart |
|
235 | return new ChartCategoryAxisX(q,presenter); | |
243 | } |
|
236 | } | |
244 | } |
|
237 | } | |
245 |
|
238 | |||
246 |
#include "moc_q |
|
239 | #include "moc_qcategoryaxis.cpp" | |
247 |
#include "moc_q |
|
240 | #include "moc_qcategoryaxis_p.cpp" | |
248 |
|
241 | |||
249 | QTCOMMERCIALCHART_END_NAMESPACE |
|
242 | QTCOMMERCIALCHART_END_NAMESPACE |
1 | NO CONTENT: file renamed from src/axis/intervalsaxis/qintervalsaxis.h to src/axis/categoryaxis/qcategoryaxis.h |
|
NO CONTENT: file renamed from src/axis/intervalsaxis/qintervalsaxis.h to src/axis/categoryaxis/qcategoryaxis.h |
@@ -30,7 +30,7 | |||||
30 | #ifndef QCATEGORYAXIS_P_H |
|
30 | #ifndef QCATEGORYAXIS_P_H | |
31 | #define QCATEGORYAXIS_P_H |
|
31 | #define QCATEGORYAXIS_P_H | |
32 |
|
32 | |||
33 |
#include "q |
|
33 | #include "qcategoryaxis.h" | |
34 | #include "qvalueaxis_p.h" |
|
34 | #include "qvalueaxis_p.h" | |
35 |
|
35 | |||
36 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
|
36 | QTCOMMERCIALCHART_BEGIN_NAMESPACE |
@@ -23,7 +23,7 | |||||
23 | #include "qvalueaxis.h" |
|
23 | #include "qvalueaxis.h" | |
24 | #include "qbarcategoryaxis.h" |
|
24 | #include "qbarcategoryaxis.h" | |
25 | #include "qvalueaxis_p.h" |
|
25 | #include "qvalueaxis_p.h" | |
26 |
#include "q |
|
26 | #include "qcategoryaxis.h" | |
27 | #include "qdatetimeaxis.h" |
|
27 | #include "qdatetimeaxis.h" | |
28 | #include "qabstractseries_p.h" |
|
28 | #include "qabstractseries_p.h" | |
29 | #include "qabstractbarseries.h" |
|
29 | #include "qabstractbarseries.h" |
@@ -21,7 +21,7 SUBDIRS += \ | |||||
21 | qhorizontalstackedbarseries \ |
|
21 | qhorizontalstackedbarseries \ | |
22 | qhorizontalpercentbarseries \ |
|
22 | qhorizontalpercentbarseries \ | |
23 | qvalueaxis \ |
|
23 | qvalueaxis \ | |
24 |
q |
|
24 | qcategoryaxis \ | |
25 | qdatetimeaxis \ |
|
25 | qdatetimeaxis \ | |
26 | qbarcategoryaxis |
|
26 | qbarcategoryaxis | |
27 |
|
27 |
@@ -2,4 +2,4 | |||||
2 | error( "Couldn't find the auto.pri file!" ) |
|
2 | error( "Couldn't find the auto.pri file!" ) | |
3 | } |
|
3 | } | |
4 | HEADERS += ../qabstractaxis/tst_qabstractaxis.h |
|
4 | HEADERS += ../qabstractaxis/tst_qabstractaxis.h | |
5 |
SOURCES += tst_q |
|
5 | SOURCES += tst_qcategoryaxis.cpp ../qabstractaxis/tst_qabstractaxis.cpp |
@@ -19,7 +19,7 | |||||
19 | ****************************************************************************/ |
|
19 | ****************************************************************************/ | |
20 |
|
20 | |||
21 | #include "../qabstractaxis/tst_qabstractaxis.h" |
|
21 | #include "../qabstractaxis/tst_qabstractaxis.h" | |
22 |
#include "q |
|
22 | #include "qcategoryaxis.h" | |
23 | #include <qlineseries.h> |
|
23 | #include <qlineseries.h> | |
24 |
|
24 | |||
25 | class tst_QCategoryAxis: public tst_QAbstractAxis |
|
25 | class tst_QCategoryAxis: public tst_QAbstractAxis | |
@@ -33,8 +33,8 public slots: | |||||
33 | void cleanup(); |
|
33 | void cleanup(); | |
34 |
|
34 | |||
35 | private slots: |
|
35 | private slots: | |
36 |
void q |
|
36 | void qcategoryaxis_data(); | |
37 |
void q |
|
37 | void qcategoryaxis(); | |
38 |
|
38 | |||
39 | void max_raw_data(); |
|
39 | void max_raw_data(); | |
40 | void max_raw(); |
|
40 | void max_raw(); | |
@@ -90,11 +90,11 void tst_QCategoryAxis::cleanup() | |||||
90 | tst_QAbstractAxis::cleanup(); |
|
90 | tst_QAbstractAxis::cleanup(); | |
91 | } |
|
91 | } | |
92 |
|
92 | |||
93 |
void tst_QCategoryAxis::q |
|
93 | void tst_QCategoryAxis::qcategoryaxis_data() | |
94 | { |
|
94 | { | |
95 | } |
|
95 | } | |
96 |
|
96 | |||
97 |
void tst_QCategoryAxis::q |
|
97 | void tst_QCategoryAxis::qcategoryaxis() | |
98 | { |
|
98 | { | |
99 | qabstractaxis(); |
|
99 | qabstractaxis(); | |
100 |
|
100 | |||
@@ -300,5 +300,5 void tst_QCategoryAxis::interval() | |||||
300 | } |
|
300 | } | |
301 |
|
301 | |||
302 | QTEST_MAIN(tst_QCategoryAxis) |
|
302 | QTEST_MAIN(tst_QCategoryAxis) | |
303 |
#include "tst_q |
|
303 | #include "tst_qcategoryaxis.moc" | |
304 |
|
304 |
General Comments 0
You need to be logged in to leave comments.
Login now