@@ -0,0 +1,83 | |||
|
1 | /**************************************************************************** | |
|
2 | ** | |
|
3 | ** Copyright (C) 2012 Digia Plc | |
|
4 | ** All rights reserved. | |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
|
6 | ** | |
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |
|
8 | ** | |
|
9 | ** $QT_BEGIN_LICENSE$ | |
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |
|
11 | ** accordance with the Qt Commercial License Agreement provided with the | |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
|
13 | ** a written agreement between you and Digia. | |
|
14 | ** | |
|
15 | ** If you have questions regarding the use of this file, please use | |
|
16 | ** contact form at http://qt.digia.com | |
|
17 | ** $QT_END_LICENSE$ | |
|
18 | ** | |
|
19 | ****************************************************************************/ | |
|
20 | ||
|
21 | #include "charts.h" | |
|
22 | #include "qchart.h" | |
|
23 | #include "qlineseries.h" | |
|
24 | #include "qvalueaxis.h" | |
|
25 | #include "qcategoryaxis.h" | |
|
26 | ||
|
27 | class MultiValueAxis2: public Chart | |
|
28 | { | |
|
29 | public: | |
|
30 | QString name() | |
|
31 | { | |
|
32 | return "AxisSet 2"; | |
|
33 | } | |
|
34 | QString category() | |
|
35 | { | |
|
36 | return QObject::tr("Axis"); | |
|
37 | } | |
|
38 | QString subCategory() | |
|
39 | { | |
|
40 | return "MultiValueAxis"; | |
|
41 | } | |
|
42 | ||
|
43 | QChart *createChart(const DataTable &table) | |
|
44 | { | |
|
45 | QChart *chart = new QChart(); | |
|
46 | QValueAxis *axisX; | |
|
47 | QValueAxis *axisY; | |
|
48 | ||
|
49 | chart->setTitle("MultiValueAxis2"); | |
|
50 | ||
|
51 | QString name("Series"); | |
|
52 | int nameIndex = 1; | |
|
53 | foreach (DataList list, table) { | |
|
54 | QLineSeries *series = new QLineSeries(chart); | |
|
55 | foreach (Data data, list) | |
|
56 | series->append(data.first); | |
|
57 | series->setName(name + QString::number(nameIndex)); | |
|
58 | ||
|
59 | chart->addSeries(series); | |
|
60 | axisX = new QValueAxis(); | |
|
61 | axisX->setLinePenColor(series->pen().color()); | |
|
62 | if (nameIndex % 2) | |
|
63 | axisX->setAlignment(Qt::AlignTop); | |
|
64 | else | |
|
65 | axisX->setAlignment(Qt::AlignBottom); | |
|
66 | axisY = new QValueAxis(); | |
|
67 | axisY->setLinePenColor(series->pen().color()); | |
|
68 | ||
|
69 | if (nameIndex % 2) | |
|
70 | axisY->setAlignment(Qt::AlignRight); | |
|
71 | else | |
|
72 | axisY->setAlignment(Qt::AlignLeft); | |
|
73 | ||
|
74 | chart->setAxisX(axisX, series); | |
|
75 | chart->setAxisY(axisY, series); | |
|
76 | nameIndex++; | |
|
77 | } | |
|
78 | ||
|
79 | return chart; | |
|
80 | } | |
|
81 | }; | |
|
82 | ||
|
83 | DECLARE_CHART(MultiValueAxis2); |
@@ -0,0 +1,88 | |||
|
1 | /**************************************************************************** | |
|
2 | ** | |
|
3 | ** Copyright (C) 2012 Digia Plc | |
|
4 | ** All rights reserved. | |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
|
6 | ** | |
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |
|
8 | ** | |
|
9 | ** $QT_BEGIN_LICENSE$ | |
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |
|
11 | ** accordance with the Qt Commercial License Agreement provided with the | |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
|
13 | ** a written agreement between you and Digia. | |
|
14 | ** | |
|
15 | ** If you have questions regarding the use of this file, please use | |
|
16 | ** contact form at http://qt.digia.com | |
|
17 | ** $QT_END_LICENSE$ | |
|
18 | ** | |
|
19 | ****************************************************************************/ | |
|
20 | ||
|
21 | #include "charts.h" | |
|
22 | #include "qchart.h" | |
|
23 | #include "qlineseries.h" | |
|
24 | #include "qvalueaxis.h" | |
|
25 | #include "qcategoryaxis.h" | |
|
26 | ||
|
27 | class MultiValueAxis3: public Chart | |
|
28 | { | |
|
29 | public: | |
|
30 | QString name() | |
|
31 | { | |
|
32 | return "AxisSet 3"; | |
|
33 | } | |
|
34 | QString category() | |
|
35 | { | |
|
36 | return QObject::tr("Axis"); | |
|
37 | } | |
|
38 | QString subCategory() | |
|
39 | { | |
|
40 | return "MultiValueAxis"; | |
|
41 | } | |
|
42 | ||
|
43 | QChart *createChart(const DataTable &table) | |
|
44 | { | |
|
45 | QChart *chart = new QChart(); | |
|
46 | QValueAxis *axisX; | |
|
47 | QValueAxis *axisY; | |
|
48 | ||
|
49 | chart->setTitle("MultiValueAxis3"); | |
|
50 | ||
|
51 | QString name("Series"); | |
|
52 | int nameIndex = 0; | |
|
53 | foreach (DataList list, table) { | |
|
54 | QLineSeries *series = new QLineSeries(chart); | |
|
55 | foreach (Data data, list) | |
|
56 | series->append(data.first); | |
|
57 | series->setName(name + QString::number(nameIndex)); | |
|
58 | ||
|
59 | chart->addSeries(series); | |
|
60 | axisX = new QValueAxis(); | |
|
61 | axisX->setLinePenColor(series->pen().color()); | |
|
62 | if (nameIndex % 2){ | |
|
63 | axisX->setAlignment(Qt::AlignTop); | |
|
64 | } else{ | |
|
65 | axisX->setAlignment(Qt::AlignBottom); | |
|
66 | } | |
|
67 | axisX->setTitle("ValueAxis for series" + QString::number(nameIndex)); | |
|
68 | ||
|
69 | axisY = new QValueAxis(); | |
|
70 | axisY->setLinePenColor(series->pen().color()); | |
|
71 | ||
|
72 | if (nameIndex % 2){ | |
|
73 | axisY->setAlignment(Qt::AlignRight); | |
|
74 | }else{ | |
|
75 | axisY->setAlignment(Qt::AlignLeft); | |
|
76 | } | |
|
77 | axisY->setTitle("ValueAxis for series" + QString::number(nameIndex)); | |
|
78 | ||
|
79 | chart->setAxisX(axisX, series); | |
|
80 | chart->setAxisY(axisY, series); | |
|
81 | nameIndex++; | |
|
82 | } | |
|
83 | ||
|
84 | return chart; | |
|
85 | } | |
|
86 | }; | |
|
87 | ||
|
88 | DECLARE_CHART(MultiValueAxis3); |
@@ -0,0 +1,85 | |||
|
1 | /**************************************************************************** | |
|
2 | ** | |
|
3 | ** Copyright (C) 2012 Digia Plc | |
|
4 | ** All rights reserved. | |
|
5 | ** For any questions to Digia, please use contact form at http://qt.digia.com | |
|
6 | ** | |
|
7 | ** This file is part of the Qt Commercial Charts Add-on. | |
|
8 | ** | |
|
9 | ** $QT_BEGIN_LICENSE$ | |
|
10 | ** Licensees holding valid Qt Commercial licenses may use this file in | |
|
11 | ** accordance with the Qt Commercial License Agreement provided with the | |
|
12 | ** Software or, alternatively, in accordance with the terms contained in | |
|
13 | ** a written agreement between you and Digia. | |
|
14 | ** | |
|
15 | ** If you have questions regarding the use of this file, please use | |
|
16 | ** contact form at http://qt.digia.com | |
|
17 | ** $QT_END_LICENSE$ | |
|
18 | ** | |
|
19 | ****************************************************************************/ | |
|
20 | ||
|
21 | #include "charts.h" | |
|
22 | #include "qchart.h" | |
|
23 | #include "qlineseries.h" | |
|
24 | #include "qvalueaxis.h" | |
|
25 | #include "qcategoryaxis.h" | |
|
26 | ||
|
27 | class MultiValueAxis4: public Chart | |
|
28 | { | |
|
29 | public: | |
|
30 | QString name() | |
|
31 | { | |
|
32 | return "AxisSet 4"; | |
|
33 | } | |
|
34 | QString category() | |
|
35 | { | |
|
36 | return QObject::tr("Axis"); | |
|
37 | } | |
|
38 | QString subCategory() | |
|
39 | { | |
|
40 | return "MultiValueAxis"; | |
|
41 | } | |
|
42 | ||
|
43 | QChart *createChart(const DataTable &table) | |
|
44 | { | |
|
45 | QChart *chart = new QChart(); | |
|
46 | QValueAxis *axisX; | |
|
47 | QValueAxis *axisY; | |
|
48 | ||
|
49 | chart->setTitle("MultiValueAxis4"); | |
|
50 | ||
|
51 | QString name("Series"); | |
|
52 | int nameIndex = 1; | |
|
53 | foreach (DataList list, table) { | |
|
54 | QLineSeries *series = new QLineSeries(chart); | |
|
55 | foreach (Data data, list) | |
|
56 | series->append(data.first); | |
|
57 | series->setName(name + QString::number(nameIndex)); | |
|
58 | ||
|
59 | chart->addSeries(series); | |
|
60 | axisX = new QValueAxis(); | |
|
61 | axisX->setLinePenColor(series->pen().color()); | |
|
62 | axisX->setTitle("ValueAxis for series" + QString::number(nameIndex)); | |
|
63 | if (nameIndex % 2) | |
|
64 | axisX->setAlignment(Qt::AlignTop); | |
|
65 | else | |
|
66 | axisX->setAlignment(Qt::AlignBottom); | |
|
67 | axisY = new QValueAxis(); | |
|
68 | axisY->setLinePenColor(series->pen().color()); | |
|
69 | axisY->setTitle("ValueAxis for series" + QString::number(nameIndex)); | |
|
70 | ||
|
71 | if (nameIndex % 2) | |
|
72 | axisY->setAlignment(Qt::AlignRight); | |
|
73 | else | |
|
74 | axisY->setAlignment(Qt::AlignLeft); | |
|
75 | ||
|
76 | chart->setAxisX(axisX, series); | |
|
77 | chart->setAxisY(axisY, series); | |
|
78 | nameIndex++; | |
|
79 | } | |
|
80 | ||
|
81 | return chart; | |
|
82 | } | |
|
83 | }; | |
|
84 | ||
|
85 | DECLARE_CHART(MultiValueAxis4); |
@@ -1,83 +1,83 | |||
|
1 | 1 | /**************************************************************************** |
|
2 | 2 | ** |
|
3 | 3 | ** Copyright (C) 2012 Digia Plc |
|
4 | 4 | ** All rights reserved. |
|
5 | 5 | ** For any questions to Digia, please use contact form at http://qt.digia.com |
|
6 | 6 | ** |
|
7 | 7 | ** This file is part of the Qt Commercial Charts Add-on. |
|
8 | 8 | ** |
|
9 | 9 | ** $QT_BEGIN_LICENSE$ |
|
10 | 10 | ** Licensees holding valid Qt Commercial licenses may use this file in |
|
11 | 11 | ** accordance with the Qt Commercial License Agreement provided with the |
|
12 | 12 | ** Software or, alternatively, in accordance with the terms contained in |
|
13 | 13 | ** a written agreement between you and Digia. |
|
14 | 14 | ** |
|
15 | 15 | ** If you have questions regarding the use of this file, please use |
|
16 | 16 | ** contact form at http://qt.digia.com |
|
17 | 17 | ** $QT_END_LICENSE$ |
|
18 | 18 | ** |
|
19 | 19 | ****************************************************************************/ |
|
20 | 20 | |
|
21 | 21 | #include "charts.h" |
|
22 | 22 | #include "qchart.h" |
|
23 | 23 | #include "qlineseries.h" |
|
24 | 24 | #include "qvalueaxis.h" |
|
25 | 25 | #include "qcategoryaxis.h" |
|
26 | 26 | |
|
27 | 27 | class MultiValueAxis: public Chart |
|
28 | 28 | { |
|
29 | 29 | public: |
|
30 | 30 | QString name() |
|
31 | 31 | { |
|
32 |
return " |
|
|
32 | return "AxisSet 1"; | |
|
33 | 33 | } |
|
34 | 34 | QString category() |
|
35 | 35 | { |
|
36 | 36 | return QObject::tr("Axis"); |
|
37 | 37 | } |
|
38 | 38 | QString subCategory() |
|
39 | 39 | { |
|
40 |
return |
|
|
40 | return "MultiValueAxis"; | |
|
41 | 41 | } |
|
42 | 42 | |
|
43 | 43 | QChart *createChart(const DataTable &table) |
|
44 | 44 | { |
|
45 | 45 | QChart *chart = new QChart(); |
|
46 | 46 | QValueAxis *axisX; |
|
47 | 47 | QValueAxis *axisY; |
|
48 | 48 | |
|
49 | chart->setTitle("MultiValueAxis"); | |
|
49 | chart->setTitle("MultiValueAxis1"); | |
|
50 | 50 | |
|
51 | 51 | QString name("Series"); |
|
52 | 52 | int nameIndex = 0; |
|
53 | 53 | foreach (DataList list, table) { |
|
54 | 54 | QLineSeries *series = new QLineSeries(chart); |
|
55 | 55 | foreach (Data data, list) |
|
56 | 56 | series->append(data.first); |
|
57 | 57 | series->setName(name + QString::number(nameIndex)); |
|
58 | 58 | |
|
59 | 59 | chart->addSeries(series); |
|
60 | 60 | axisX = new QValueAxis(); |
|
61 | 61 | axisX->setLinePenColor(series->pen().color()); |
|
62 | 62 | if (nameIndex % 2) |
|
63 | 63 | axisX->setAlignment(Qt::AlignTop); |
|
64 | 64 | else |
|
65 | 65 | axisX->setAlignment(Qt::AlignBottom); |
|
66 | 66 | axisY = new QValueAxis(); |
|
67 | 67 | axisY->setLinePenColor(series->pen().color()); |
|
68 | 68 | |
|
69 | 69 | if (nameIndex % 2) |
|
70 | 70 | axisY->setAlignment(Qt::AlignRight); |
|
71 | 71 | else |
|
72 | 72 | axisY->setAlignment(Qt::AlignLeft); |
|
73 | 73 | |
|
74 | 74 | chart->setAxisX(axisX, series); |
|
75 | 75 | chart->setAxisY(axisY, series); |
|
76 | 76 | nameIndex++; |
|
77 | 77 | } |
|
78 | 78 | |
|
79 | 79 | return chart; |
|
80 | 80 | } |
|
81 | 81 | }; |
|
82 | 82 | |
|
83 | 83 | DECLARE_CHART(MultiValueAxis); |
@@ -1,23 +1,26 | |||
|
1 | 1 | INCLUDEPATH += $$PWD |
|
2 | 2 | DEPENDPATH += $$PWD |
|
3 | 3 | SOURCES += \ |
|
4 | 4 | font/font.cpp \ |
|
5 | 5 | xyseries/linechart.cpp \ |
|
6 | 6 | xyseries/scatterchart.cpp \ |
|
7 | 7 | xyseries/splinechart.cpp \ |
|
8 | 8 | xyseries/areachart.cpp \ |
|
9 | 9 | barseries/verticalstackedbarchart.cpp \ |
|
10 | 10 | barseries/horizontalstackedbarchart.cpp \ |
|
11 | 11 | barseries/verticalbarchart.cpp \ |
|
12 | 12 | barseries/horizontalbarchart.cpp \ |
|
13 | 13 | barseries/horizontalpercentbarchart.cpp \ |
|
14 | 14 | barseries/verticalpercentbarchart.cpp \ |
|
15 | 15 | pieseries/piechart.cpp \ |
|
16 | 16 | pieseries/donutchart.cpp \ |
|
17 | 17 | axis/valueaxis.cpp \ |
|
18 | 18 | axis/categoryaxis.cpp \ |
|
19 | 19 | axis/barcategoryaxisx.cpp \ |
|
20 | 20 | axis/barcategoryaxisy.cpp \ |
|
21 | 21 | axis/datetimeaxisx.cpp \ |
|
22 | 22 | axis/datetimeaxisy.cpp \ |
|
23 | axis/multivalueaxis.cpp | |
|
23 | axis/multivalueaxis.cpp \ | |
|
24 | axis/multivalueaxis2.cpp \ | |
|
25 | axis/multivalueaxis3.cpp \ | |
|
26 | axis/multivalueaxis4.cpp No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now