@@ -1,62 +1,62 | |||
|
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 "qlogvalueaxis.h" |
|
25 | 25 | #include "qvalueaxis.h" |
|
26 | 26 | |
|
27 | 27 | class LineLogXY: public Chart |
|
28 | 28 | { |
|
29 | 29 | public: |
|
30 | 30 | QString name() { return "Line LogX Y"; } |
|
31 | 31 | QString category() { return QObject::tr("Domain"); } |
|
32 | 32 | QString subCategory() { return QObject::tr("Both Log"); } |
|
33 | 33 | |
|
34 | 34 | QChart *createChart(const DataTable &table) |
|
35 | 35 | { |
|
36 | 36 | QChart *chart = new QChart(); |
|
37 | 37 | chart->setTitle("Line: Log X, Y"); |
|
38 | 38 | |
|
39 | 39 | QString name("Series "); |
|
40 | 40 | int nameIndex = 0; |
|
41 | 41 | foreach (DataList list, table) { |
|
42 | 42 | QLineSeries *series = new QLineSeries(chart); |
|
43 | 43 | foreach (Data data, list) |
|
44 | 44 | series->append(data.first); |
|
45 | 45 | series->setName(name + QString::number(nameIndex)); |
|
46 | 46 | nameIndex++; |
|
47 | 47 | chart->addSeries(series); |
|
48 | 48 | } |
|
49 | 49 | |
|
50 | 50 | QLogValueAxis *axisX= new QLogValueAxis(); |
|
51 |
axisX->setBase( |
|
|
51 | axisX->setBase(2); | |
|
52 | 52 | QValueAxis *axisY= new QValueAxis(); |
|
53 | 53 | foreach (QAbstractSeries *series, chart->series()) { |
|
54 | 54 | chart->setAxisX(axisX, series); |
|
55 | 55 | chart->setAxisY(axisY, series); |
|
56 | 56 | } |
|
57 | 57 | |
|
58 | 58 | return chart; |
|
59 | 59 | } |
|
60 | 60 | }; |
|
61 | 61 | |
|
62 | 62 | DECLARE_CHART(LineLogXY); |
@@ -1,62 +1,62 | |||
|
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 "qscatterseries.h" |
|
24 | 24 | #include "qlogvalueaxis.h" |
|
25 | 25 | |
|
26 | 26 | class ScatterLogXLogY: public Chart |
|
27 | 27 | { |
|
28 | 28 | public: |
|
29 | 29 | QString name() { return "Scatter LogX LogY"; } |
|
30 | 30 | QString category() { return QObject::tr("Domain"); } |
|
31 | 31 | QString subCategory() { return QObject::tr("Both Log"); } |
|
32 | 32 | |
|
33 | 33 | QChart *createChart(const DataTable &table) |
|
34 | 34 | { |
|
35 | 35 | QChart *chart = new QChart(); |
|
36 | 36 | chart->setTitle("Scatter: Log X, Log Y"); |
|
37 | 37 | |
|
38 | 38 | QString name("Series "); |
|
39 | 39 | int nameIndex = 0; |
|
40 | 40 | foreach (DataList list, table) { |
|
41 | 41 | QScatterSeries *series = new QScatterSeries(chart); |
|
42 | 42 | foreach (Data data, list) |
|
43 | 43 | series->append(data.first); |
|
44 | 44 | series->setName(name + QString::number(nameIndex)); |
|
45 | 45 | nameIndex++; |
|
46 | 46 | chart->addSeries(series); |
|
47 | 47 | } |
|
48 | 48 | |
|
49 | 49 | QLogValueAxis *axisX= new QLogValueAxis(); |
|
50 |
axisX->setBase( |
|
|
50 | axisX->setBase(2); | |
|
51 | 51 | QLogValueAxis *axisY= new QLogValueAxis(); |
|
52 | 52 | axisY->setBase(2); |
|
53 | 53 | foreach (QAbstractSeries *series, chart->series()) { |
|
54 | 54 | chart->setAxisX(axisX, series); |
|
55 | 55 | chart->setAxisY(axisY, series); |
|
56 | 56 | } |
|
57 | 57 | |
|
58 | 58 | return chart; |
|
59 | 59 | } |
|
60 | 60 | }; |
|
61 | 61 | |
|
62 | 62 | DECLARE_CHART(ScatterLogXLogY); |
@@ -1,62 +1,62 | |||
|
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 "qscatterseries.h" |
|
24 | 24 | #include "qlogvalueaxis.h" |
|
25 | 25 | #include "qvalueaxis.h" |
|
26 | 26 | |
|
27 | 27 | class ScatterLogXY: public Chart |
|
28 | 28 | { |
|
29 | 29 | public: |
|
30 | 30 | QString name() { return "Scatter LogX Y"; } |
|
31 | 31 | QString category() { return QObject::tr("Domain"); } |
|
32 | 32 | QString subCategory() { return QObject::tr("Both Log"); } |
|
33 | 33 | |
|
34 | 34 | QChart *createChart(const DataTable &table) |
|
35 | 35 | { |
|
36 | 36 | QChart *chart = new QChart(); |
|
37 | 37 | chart->setTitle("Scatter: Log X, Y"); |
|
38 | 38 | |
|
39 | 39 | QString name("Series "); |
|
40 | 40 | int nameIndex = 0; |
|
41 | 41 | foreach (DataList list, table) { |
|
42 | 42 | QScatterSeries *series = new QScatterSeries(chart); |
|
43 | 43 | foreach (Data data, list) |
|
44 | 44 | series->append(data.first); |
|
45 | 45 | series->setName(name + QString::number(nameIndex)); |
|
46 | 46 | nameIndex++; |
|
47 | 47 | chart->addSeries(series); |
|
48 | 48 | } |
|
49 | 49 | |
|
50 | 50 | QLogValueAxis *axisX= new QLogValueAxis(); |
|
51 |
axisX->setBase( |
|
|
51 | axisX->setBase(2); | |
|
52 | 52 | QValueAxis *axisY= new QValueAxis(); |
|
53 | 53 | foreach (QAbstractSeries *series, chart->series()) { |
|
54 | 54 | chart->setAxisX(axisX, series); |
|
55 | 55 | chart->setAxisY(axisY, series); |
|
56 | 56 | } |
|
57 | 57 | |
|
58 | 58 | return chart; |
|
59 | 59 | } |
|
60 | 60 | }; |
|
61 | 61 | |
|
62 | 62 | DECLARE_CHART(ScatterLogXY); |
@@ -1,62 +1,62 | |||
|
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 "qsplineseries.h" |
|
24 | 24 | #include "qlogvalueaxis.h" |
|
25 | 25 | |
|
26 | 26 | class SplineLogXLogY: public Chart |
|
27 | 27 | { |
|
28 | 28 | public: |
|
29 | 29 | QString name() { return "Spline LogX LogY"; } |
|
30 | 30 | QString category() { return QObject::tr("Domain"); } |
|
31 | 31 | QString subCategory() { return QObject::tr("Both Log"); } |
|
32 | 32 | |
|
33 | 33 | QChart *createChart(const DataTable &table) |
|
34 | 34 | { |
|
35 | 35 | QChart *chart = new QChart(); |
|
36 | 36 | chart->setTitle("Spline: Log X, Log Y"); |
|
37 | 37 | |
|
38 | 38 | QString name("Series "); |
|
39 | 39 | int nameIndex = 0; |
|
40 | 40 | foreach (DataList list, table) { |
|
41 | 41 | QSplineSeries *series = new QSplineSeries(chart); |
|
42 | 42 | foreach (Data data, list) |
|
43 | 43 | series->append(data.first); |
|
44 | 44 | series->setName(name + QString::number(nameIndex)); |
|
45 | 45 | nameIndex++; |
|
46 | 46 | chart->addSeries(series); |
|
47 | 47 | } |
|
48 | 48 | |
|
49 | 49 | QLogValueAxis *axisX= new QLogValueAxis(); |
|
50 |
axisX->setBase( |
|
|
50 | axisX->setBase(2); | |
|
51 | 51 | QLogValueAxis *axisY= new QLogValueAxis(); |
|
52 | 52 | axisY->setBase(2); |
|
53 | 53 | foreach (QAbstractSeries *series, chart->series()) { |
|
54 | 54 | chart->setAxisX(axisX, series); |
|
55 | 55 | chart->setAxisY(axisY, series); |
|
56 | 56 | } |
|
57 | 57 | |
|
58 | 58 | return chart; |
|
59 | 59 | } |
|
60 | 60 | }; |
|
61 | 61 | |
|
62 | 62 | DECLARE_CHART(SplineLogXLogY); |
@@ -1,62 +1,62 | |||
|
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 "qsplineseries.h" |
|
24 | 24 | #include "qlogvalueaxis.h" |
|
25 | 25 | #include "qvalueaxis.h" |
|
26 | 26 | |
|
27 | 27 | class SplineLogXY: public Chart |
|
28 | 28 | { |
|
29 | 29 | public: |
|
30 | 30 | QString name() { return "Spline LogX Y"; } |
|
31 | 31 | QString category() { return QObject::tr("Domain"); } |
|
32 | 32 | QString subCategory() { return QObject::tr("Both Log"); } |
|
33 | 33 | |
|
34 | 34 | QChart *createChart(const DataTable &table) |
|
35 | 35 | { |
|
36 | 36 | QChart *chart = new QChart(); |
|
37 | 37 | chart->setTitle("Spline: Log X, Y"); |
|
38 | 38 | |
|
39 | 39 | QString name("Series "); |
|
40 | 40 | int nameIndex = 0; |
|
41 | 41 | foreach (DataList list, table) { |
|
42 | 42 | QSplineSeries *series = new QSplineSeries(chart); |
|
43 | 43 | foreach (Data data, list) |
|
44 | 44 | series->append(data.first); |
|
45 | 45 | series->setName(name + QString::number(nameIndex)); |
|
46 | 46 | nameIndex++; |
|
47 | 47 | chart->addSeries(series); |
|
48 | 48 | } |
|
49 | 49 | |
|
50 | 50 | QLogValueAxis *axisX= new QLogValueAxis(); |
|
51 |
axisX->setBase( |
|
|
51 | axisX->setBase(2); | |
|
52 | 52 | QValueAxis *axisY= new QValueAxis(); |
|
53 | 53 | foreach (QAbstractSeries *series, chart->series()) { |
|
54 | 54 | chart->setAxisX(axisX, series); |
|
55 | 55 | chart->setAxisY(axisY, series); |
|
56 | 56 | } |
|
57 | 57 | |
|
58 | 58 | return chart; |
|
59 | 59 | } |
|
60 | 60 | }; |
|
61 | 61 | |
|
62 | 62 | DECLARE_CHART(SplineLogXY); |
General Comments 0
You need to be logged in to leave comments.
Login now