##// END OF EJS Templates
Fix Charts QML api auto test...
Titta Heikkala -
r2638:c98d8af1763d
parent child
Show More
@@ -0,0 +1,107
1 /****************************************************************************
2 **
3 ** Copyright (C) 2013 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 Enterprise Charts Add-on.
8 **
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise 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 import QtQuick 2.0
22 import QtTest 1.0
23 import QtCommercial.Chart 1.2
24
25 Rectangle {
26 width: 400
27 height: 300
28
29 TestCase {
30 id: tc1
31 name: "tst_qml-qtquicktest BarCategoryAxis 1.2"
32 when: windowShown
33
34 function test_minMax() {
35 compare(barSeries1.axisX.min, "Jan", "AxisX min");
36 compare(barSeries1.axisX.max, "Jun", "AxisX max");
37 compare(barSeries1.axisY.min, 0, "AxisY min");
38 compare(barSeries1.axisY.max, 10, "AxisY max");
39 }
40
41 function test_categories() {
42 compare(barSeries1.axisX.count, 6, "AxisX count");
43 categoriesCountChangedSpy.clear();
44 categoriesChangedSpy.clear();
45
46 // Replace categories
47 barSeries1.axisX.categories = ["Tam", "Hel", "Maa", "Huh"];
48 compare(barSeries1.axisX.count, 4, "AxisX count");
49 compare(categoriesCountChangedSpy.count, 1, "onCountChanged");
50 compare(categoriesChangedSpy.count, 1, "onCategoriesChanged");
51
52 // Reset the original categories
53 barSeries1.axisX.categories = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"]
54 compare(barSeries1.axisX.count, 6, "AxisX count");
55 compare(categoriesCountChangedSpy.count, 2, "onCountChanged");
56 compare(categoriesChangedSpy.count, 2, "onCategoriesChanged");
57 }
58
59 function test_minMaxChanged() {
60 axisY.min = -1;
61 compare(minChangedSpy.count, 1, "onMinChanged");
62 compare(maxChangedSpy.count, 0, "onMaxChanged");
63 axisY.max = 12;
64 compare(minChangedSpy.count, 1, "onMinChanged");
65 compare(maxChangedSpy.count, 1, "onMaxChanged");
66 }
67 }
68
69 ChartView {
70 id: chartView
71 anchors.fill: parent
72
73 BarSeries {
74 id: barSeries1
75 axisX: BarCategoryAxis {
76 id: axisX
77 categories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun" ]
78 }
79 axisY: ValuesAxis {
80 id: axisY
81 min: 0
82 max: 10
83 }
84 }
85
86 SignalSpy {
87 id: categoriesCountChangedSpy
88 target: axisX
89 signalName: "countChanged"
90 }
91 SignalSpy {
92 id: categoriesChangedSpy
93 target: axisX
94 signalName: "categoriesChanged"
95 }
96 SignalSpy {
97 id: minChangedSpy
98 target: axisY
99 signalName: "minChanged"
100 }
101 SignalSpy {
102 id: maxChangedSpy
103 target: axisY
104 signalName: "maxChanged"
105 }
106 }
107 }
@@ -0,0 +1,146
1 /****************************************************************************
2 **
3 ** Copyright (C) 2013 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 Enterprise Charts Add-on.
8 **
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise 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 import QtQuick 2.0
22 import QtTest 1.0
23 import QtCommercial.Chart 1.2
24
25 Rectangle {
26 width: 400
27 height: 300
28
29 TestCase {
30 id: tc1
31 name: "tst_qml-qtquicktest BarSeries 1.2"
32 when: windowShown
33
34 function test_properties() {
35 compare(barSeries.barWidth, 0.5);
36 compare(barSeries.labelsVisible, false);
37 }
38
39 function test_axes() {
40 verify(chartView.axisX() == barSeries.axisX);
41 verify(chartView.axisY() == barSeries.axisY);
42
43 compare(barSeries.axisX, stackedBarSeries.axisX);
44 compare(barSeries.axisY, stackedBarSeries.axisY);
45
46 compare(barSeries.axisX, percentBarSeries.axisX);
47 compare(barSeries.axisY, percentBarSeries.axisY);
48 }
49
50 function test_append() {
51 var setCount = 5;
52 var valueCount = 50;
53 addedSpy.clear();
54 append(setCount, valueCount);
55
56 compare(barSeries.count, setCount);
57 for (var k = 0; k < setCount; k++) {
58 compare(barSeries.at(k).count, valueCount);
59 compare(barSeries.at(k).label, "barset" + k);
60 }
61 compare(addedSpy.count, setCount);
62
63 barSeries.clear();
64 compare(barSeries.count, 0);
65 }
66
67 function test_insert() {
68 var setCount = 5;
69 var valueCount = 50;
70 addedSpy.clear();
71 append(setCount, valueCount);
72
73 for (var i = 0; i < setCount; i++) {
74 var values = [];
75 for (var j = 0; j < valueCount; j++)
76 values[j] = Math.random() * 10;
77 var set = barSeries.insert(i, "barset" + i, values);
78 compare(set.label, "barset" + i);
79 }
80
81 compare(barSeries.count, setCount * 2);
82 for (var k = 0; k < setCount * 2; k++)
83 compare(barSeries.at(k).count, valueCount);
84 compare(addedSpy.count, 2 * setCount);
85
86 barSeries.clear();
87 compare(barSeries.count, 0);
88 }
89
90 function test_remove() {
91 var setCount = 5;
92 var valueCount = 50;
93 removedSpy.clear();
94 append(setCount, valueCount);
95
96 for (var k = 0; k < setCount; k++)
97 barSeries.remove(barSeries.at(0));
98
99 compare(barSeries.count, 0);
100 compare(removedSpy.count, setCount);
101 }
102
103 // Not a test function, used by one or more test functions
104 function append(setCount, valueCount) {
105 for (var i = 0; i < setCount; i++) {
106 var values = [];
107 for (var j = 0; j < valueCount; j++)
108 values[j] = Math.random() * 10;
109 barSeries.append("barset" + i, values);
110 }
111 }
112 }
113
114 ChartView {
115 id: chartView
116 anchors.fill: parent
117
118 BarSeries {
119 id: barSeries
120 name: "bar"
121 axisX: BarCategoryAxis {}
122 axisY: ValueAxis { min: 0; max: 10 }
123
124 SignalSpy {
125 id: addedSpy
126 target: barSeries
127 signalName: "barsetsAdded"
128 }
129 SignalSpy {
130 id: removedSpy
131 target: barSeries
132 signalName: "barsetsRemoved"
133 }
134 }
135
136 StackedBarSeries {
137 id: stackedBarSeries
138 name: "stackedBar"
139 }
140
141 PercentBarSeries {
142 id: percentBarSeries
143 name: "percentBar"
144 }
145 }
146 }
@@ -0,0 +1,96
1 /****************************************************************************
2 **
3 ** Copyright (C) 2013 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 Enterprise Charts Add-on.
8 **
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise 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 import QtQuick 2.0
22 import QtTest 1.0
23 import QtCommercial.Chart 1.3
24
25 Rectangle {
26 width: 400
27 height: 300
28
29 TestCase {
30 id: tc1
31 name: "tst_qml-qtquicktest BoxPlotSeries"
32 when: windowShown
33
34 function test_properties() {
35 compare(boxPlotSeries.boxWidth, 0.5);
36 }
37
38 function test_setproperties() {
39 var set = boxPlotSeries.append("boxplot", [1, 2, 5, 6, 8]);
40 compare(set.label, "boxplot");
41 compare(set.count, 5);
42 }
43
44 function test_append() {
45 addedSpy.clear();
46 countChangedSpy.clear();
47 var count = 50;
48 for (var i = 0; i < count; i++)
49 boxPlotSeries.append("boxplot" + i, Math.random());
50 compare(addedSpy.count, count);
51 compare(countChangedSpy.count, count);
52 console.log("Check the series count once QTRD-2504 is implemented");
53 boxPlotSeries.clear();
54 }
55
56 function test_remove() {
57 removedSpy.clear();
58 countChangedSpy.clear();
59 var count = 50;
60 for (var i = 0; i < count; i++)
61 boxPlotSeries.append("boxplot" + i, Math.random());
62 for (var j = 0; j < count; j++)
63 boxPlotSeries.remove(boxPlotSeries.at(0));
64 compare(removedSpy.count, count);
65 compare(countChangedSpy.count, 2 * count);
66 console.log("Check the series count once QTRD-2504 is implemented");
67 }
68 }
69
70 ChartView {
71 id: chartView
72 anchors.fill: parent
73
74 BoxPlotSeries {
75 id: boxPlotSeries
76 name: "boxplot"
77 BoxSet { label: "Jan"; values: [3, 4, 5.1, 6.2, 8.5] }
78
79 SignalSpy {
80 id: addedSpy
81 target: boxPlotSeries
82 signalName: "boxsetsAdded"
83 }
84 SignalSpy {
85 id: removedSpy
86 target: boxPlotSeries
87 signalName: "boxsetsRemoved"
88 }
89 SignalSpy {
90 id: countChangedSpy
91 target: boxPlotSeries
92 signalName: "countChanged"
93 }
94 }
95 }
96 }
@@ -0,0 +1,84
1 /****************************************************************************
2 **
3 ** Copyright (C) 2013 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 Enterprise Charts Add-on.
8 **
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise 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 import QtQuick 2.0
22 import QtTest 1.0
23 import QtCommercial.Chart 1.2
24
25 Rectangle {
26 width: 400
27 height: 300
28
29 TestCase {
30 id: tc1
31 name: "tst_qml-qtquicktest CategoryAxis 1.2"
32 when: windowShown
33
34 function test_minMax() {
35 compare(lineSeries1.axisX.min, 0, "AxisX min");
36 compare(lineSeries1.axisX.max, 10, "AxisX max");
37 compare(lineSeries1.axisY.min, 0, "AxisY min");
38 compare(lineSeries1.axisY.max, 10, "AxisY max");
39 }
40
41 function test_categories() {
42 compare(lineSeries1.axisY.startValue, 0, "AxisY start value");
43 compare(lineSeries1.axisY.count, 3, "AxisY count");
44 compare(lineSeries1.axisY.categoriesLabels[0], "label0", "AxisY categories labels");
45 compare(lineSeries1.axisY.categoriesLabels[1], "label1", "AxisY categories labels");
46 compare(lineSeries1.axisY.categoriesLabels[2], "label2", "AxisY categories labels");
47 }
48 }
49
50 ChartView {
51 id: chartView
52 anchors.fill: parent
53
54 LineSeries {
55 id: lineSeries1
56 axisX: ValuesAxis {
57 id: axisX
58 min: 0
59 max: 10
60 }
61 axisY: CategoryAxis {
62 id: axisY
63 min: 0
64 max: 10
65 startValue: 0
66 CategoryRange {
67 label: "label0"
68 endValue: 1
69 }
70 CategoryRange {
71 label: "label1"
72 endValue: 3
73 }
74 CategoryRange {
75 label: "label2"
76 endValue: 10
77 }
78 }
79 XYPoint { x: -1; y: -1 }
80 XYPoint { x: 0; y: 0 }
81 XYPoint { x: 5; y: 5 }
82 }
83 }
84 }
@@ -0,0 +1,79
1 /****************************************************************************
2 **
3 ** Copyright (C) 2013 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 Enterprise Charts Add-on.
8 **
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise 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 import QtQuick 2.0
22 import QtTest 1.0
23 import QtCommercial.Chart 1.2
24
25 Rectangle {
26 width: 400
27 height: 300
28
29 TestCase {
30 id: tc1
31 name: "tst_qml-qtquicktest ChartView Properties 1.2"
32 when: windowShown
33
34 function test_chartViewProperties() {
35 compare(chartView.animationOptions, ChartView.NoAnimation, "ChartView.animationOptions");
36 verify(chartView.backgroundColor != undefined);
37 verify(chartView.margins.bottom > 0, "ChartView.margins.bottom");
38 verify(chartView.margins.top > 0, "ChartView.margins.top");
39 verify(chartView.margins.left > 0, "ChartView.margins.left");
40 verify(chartView.margins.right > 0, "ChartView.margins.right");
41 compare(chartView.count, 0, "ChartView.count");
42 compare(chartView.dropShadowEnabled, false, "ChartView.dropShadowEnabled");
43 verify(chartView.plotArea.height > 0, "ChartView.plotArea.height");
44 verify(chartView.plotArea.width > 0, "ChartView.plotArea.width");
45 verify(chartView.plotArea.x > 0, "ChartView.plotArea.x");
46 verify(chartView.plotArea.y > 0, "ChartView.plotArea.y");
47 compare(chartView.theme, ChartView.ChartThemeLight, "ChartView.theme");
48 compare(chartView.title, "", "ChartView.title");
49 compare(chartView.title, "", "ChartView.title");
50 verify(chartView.titleColor != undefined, "ChartView.titleColor");
51 compare(chartView.titleFont.bold, false, "ChartView.titleFont.bold");
52 // Legend
53 compare(chartView.legend.visible, true, "ChartView.legend.visible");
54 compare(chartView.legend.alignment, Qt.AlignTop, "ChartView.legend.alignment");
55 compare(chartView.legend.backgroundVisible, false, "ChartView.legend.backgroundVisible");
56 verify(chartView.legend.borderColor != undefined, "ChartView.legend.borderColor");
57 verify(chartView.legend.color != undefined, "ChartView.legend.color");
58 // Legend font
59 compare(chartView.legend.font.bold, false, "ChartView.legend.font.bold");
60 compare(chartView.legend.font.capitalization, Font.MixedCase, "ChartView.legend.font.capitalization");
61 verify(chartView.legend.font.family != "", "ChartView.legend.font.family");
62 compare(chartView.legend.font.italic, false, "ChartView.legend.font.italic");
63 compare(chartView.legend.font.letterSpacing, 0.0, "ChartView.legend.font.letterSpacing");
64 verify(chartView.legend.font.pixelSize > 0
65 && chartView.legend.font.pixelSize < 50, "ChartView.legend.font.pixelSize");
66 verify(chartView.legend.font.pointSize > 0
67 && chartView.legend.font.pointSize < 50, "ChartView.legend.font.pointSize");
68 compare(chartView.legend.font.strikeout, false, "ChartView.legend.font.strikeout");
69 compare(chartView.legend.font.underline, false, "ChartView.legend.font.underline");
70 compare(chartView.legend.font.weight, Font.Normal, "ChartView.legend.font.weight");
71 compare(chartView.legend.font.wordSpacing, 0.0, "ChartView.legend.font.wordSpacing");
72 }
73 }
74
75 ChartView {
76 id: chartView
77 anchors.fill: parent
78 }
79 }
@@ -0,0 +1,160
1 /****************************************************************************
2 **
3 ** Copyright (C) 2013 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 Enterprise Charts Add-on.
8 **
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise 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 import QtQuick 2.0
22 import QtTest 1.0
23 import QtCommercial.Chart 1.2
24
25 Rectangle {
26 width: 400
27 height: 300
28
29 TestCase {
30 id: tc1
31 name: "tst_qml-qtquicktest ChartView Functions 1.2"
32 when: windowShown
33
34 function test_chartViewSeriesAndAxes() {
35 // Create XY series
36 var line = chartView.createSeries(ChartView.SeriesTypeLine, "line");
37 verify(line != null && line != undefined);
38 var spline = chartView.createSeries(ChartView.SeriesTypeSpline, "spline");
39 verify(spline != null && spline != undefined);
40 var scatter = chartView.createSeries(ChartView.SeriesTypeScatter, "scatter");
41 verify(scatter != null && scatter != undefined);
42
43 // Create a series with specific axes
44 var line2 = chartView.createSeries(ChartView.SeriesTypeLine, "line2", chartView.axisX(line), chartView.axisY(line));
45
46 // Check that all the XY series use the same axes
47 verify(chartView.axisX(line) != null);
48 verify(chartView.axisY(line) != null);
49 compare(chartView.axisX(line), chartView.axisX(line2));
50 compare(chartView.axisY(line), chartView.axisY(line2));
51 compare(chartView.axisX(line), chartView.axisX(spline));
52 compare(chartView.axisY(line), chartView.axisY(spline));
53 compare(chartView.axisX(line), chartView.axisX(scatter));
54 compare(chartView.axisY(line), chartView.axisY(scatter));
55
56 var bar = chartView.createSeries(ChartView.SeriesTypeBar, "bar");
57 verify(bar != null && bar != undefined);
58 var stackedbar = chartView.createSeries(ChartView.SeriesTypeStackedBar, "stackedbar");
59 verify(stackedbar != null && stackedbar != undefined);
60 var percentbar = chartView.createSeries(ChartView.SeriesTypePercentBar, "percentbar");
61 verify(percentbar != null && percentbar != undefined);
62 var horizontalbar = chartView.createSeries(ChartView.SeriesTypeHorizontalBar, "horizontalbar");
63 verify(horizontalbar != null && horizontalbar != undefined);
64 var horizontalstackedbar = chartView.createSeries(ChartView.SeriesTypeHorizontalStackedBar, "horizontalstackedbar");
65 verify(horizontalstackedbar != null && horizontalstackedbar != undefined);
66 var horizontalpercentbar = chartView.createSeries(ChartView.SeriesTypeHorizontalPercentBar, "horizontalpercentbar");
67 verify(horizontalpercentbar != null && horizontalpercentbar != undefined);
68 var area = chartView.createSeries(ChartView.SeriesTypeArea, "area");
69 verify(area != null && area != undefined);
70
71 // Remove all series
72 chartView.removeAllSeries();
73 compare(chartView.count, 0);
74 }
75
76 function test_chartViewRange() {
77 // Set initial values
78 chartView.createSeries(ChartView.SeriesTypeLine, "line");
79 verify(chartView.axisX() != null);
80 verify(chartView.axisY() != null);
81 chartView.axisX().min = 1.0;
82 chartView.axisX().max = 2.0;
83 chartView.axisY().min = 1.0;
84 chartView.axisY().max = 2.0;
85
86 var xMax = chartView.axisX().max;
87 var xMin = chartView.axisX().min;
88 var yMax = chartView.axisY().max;
89 var yMin = chartView.axisY().min;
90
91 // zoom x 2.5
92 chartView.zoom(1.5);
93 verify(chartView.axisX().max < xMax);
94 verify(chartView.axisX().min > xMin);
95 verify(chartView.axisY().max < yMax);
96 verify(chartView.axisY().min > yMin);
97 xMax = chartView.axisX().max;
98 xMin = chartView.axisX().min;
99 yMax = chartView.axisY().max;
100 yMin = chartView.axisY().min;
101
102 // zoom x 0.5
103 chartView.zoom(0.5);
104 verify(chartView.axisX().max > xMax);
105 verify(chartView.axisX().min < xMin);
106 verify(chartView.axisY().max > yMax);
107 verify(chartView.axisY().min < yMin);
108 xMax = chartView.axisX().max;
109 xMin = chartView.axisX().min;
110 yMax = chartView.axisY().max;
111 yMin = chartView.axisY().min;
112
113 // Scroll up
114 chartView.scrollUp(10);
115 compare(chartView.axisX().max, xMax);
116 compare(chartView.axisX().min, xMin);
117 verify(chartView.axisY().max > yMax);
118 verify(chartView.axisY().min > yMin);
119 xMax = chartView.axisX().max;
120 xMin = chartView.axisX().min;
121 yMax = chartView.axisY().max;
122 yMin = chartView.axisY().min;
123
124 // Scroll down
125 chartView.scrollDown(10);
126 compare(chartView.axisX().max, xMax);
127 compare(chartView.axisX().min, xMin);
128 verify(chartView.axisY().max < yMax);
129 verify(chartView.axisY().min < yMin);
130 xMax = chartView.axisX().max;
131 xMin = chartView.axisX().min;
132 yMax = chartView.axisY().max;
133 yMin = chartView.axisY().min;
134
135 // Scroll left
136 chartView.scrollLeft(10);
137 verify(chartView.axisX().max < xMax);
138 verify(chartView.axisX().min < xMin);
139 compare(chartView.axisY().max, yMax);
140 compare(chartView.axisY().min, yMin);
141 xMax = chartView.axisX().max;
142 xMin = chartView.axisX().min;
143 yMax = chartView.axisY().max;
144 yMin = chartView.axisY().min;
145
146 // Scroll right
147 chartView.scrollRight(10);
148 verify(chartView.axisX().max > xMax);
149 verify(chartView.axisX().min > xMin);
150 compare(chartView.axisY().max, yMax);
151 compare(chartView.axisY().min, yMin);
152 }
153 }
154
155 ChartView {
156 id: chartView
157 anchors.fill: parent
158 title: "Chart"
159 }
160 }
@@ -0,0 +1,73
1 /****************************************************************************
2 **
3 ** Copyright (C) 2013 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 Enterprise Charts Add-on.
8 **
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise 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 import QtQuick 2.0
22 import QtTest 1.0
23 import QtCommercial.Chart 1.2
24
25 Rectangle {
26 width: 400
27 height: 300
28
29 TestCase {
30 id: tc1
31 name: "tst_qml-qtquicktest ChartView Signals 1.2"
32 when: windowShown
33
34 // Verify onSeriesAdded and onSeriesRemoved signals
35 function test_chartView() {
36 var series = chartView.createSeries(ChartView.SeriesTypeLine, "line");
37 seriesAddedSpy.wait();
38 compare(seriesAddedSpy.count, 1, "ChartView.onSeriesAdded");
39
40 // Modifying layout triggers more than one plotAreaChanged signal
41 chartView.titleFont.pixelSize = 50;
42 verify(plotAreaChangedSpy.count > 0, "ChartView.onPlotAreaChanged");
43
44 chartView.removeSeries(series);
45 seriesRemovedSpy.wait();
46 compare(seriesRemovedSpy.count, 1, "ChartView.onSeriesAdded");
47 }
48 }
49
50 ChartView {
51 id: chartView
52 anchors.fill: parent
53 title: "Chart"
54
55 SignalSpy {
56 id: plotAreaChangedSpy
57 target: chartView
58 signalName: "plotAreaChanged"
59 }
60
61 SignalSpy {
62 id: seriesAddedSpy
63 target: chartView
64 signalName: "seriesAdded"
65 }
66
67 SignalSpy {
68 id: seriesRemovedSpy
69 target: chartView
70 signalName: "seriesRemoved"
71 }
72 }
73 }
@@ -0,0 +1,131
1 /****************************************************************************
2 **
3 ** Copyright (C) 2013 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 Enterprise Charts Add-on.
8 **
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise 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 import QtQuick 2.0
22 import QtTest 1.0
23 import QtCommercial.Chart 1.2
24
25 Rectangle {
26 width: 400
27 height: 300
28
29 TestCase {
30 id: tc1
31 name: "tst_qml-qtquicktest PieSeries 1.2"
32 when: windowShown
33
34 function test_properties() {
35 compare(pieSeries.endAngle, 360);
36 compare(pieSeries.holeSize, 0);
37 compare(pieSeries.horizontalPosition, 0.5);
38 compare(pieSeries.size, 0.7);
39 compare(pieSeries.startAngle, 0);
40 compare(pieSeries.sum, 0);
41 compare(pieSeries.verticalPosition, 0.5);
42 }
43
44 function test_sliceproperties() {
45 var slice = pieSeries.append("slice", 10);
46 compare(slice.angleSpan, 360.0);
47 verify(slice.borderColor != undefined);
48 compare(slice.borderWidth, 1);
49 verify(slice.color != undefined);
50 compare(slice.explodeDistanceFactor, 0.15);
51 compare(slice.exploded, false);
52 compare(slice.label, "slice");
53 compare(slice.labelArmLengthFactor, 0.15);
54 verify(slice.labelColor != undefined);
55 compare(slice.labelFont.bold, false);
56 compare(slice.labelPosition, PieSlice.LabelOutside);
57 compare(slice.labelVisible, false);
58 compare(slice.percentage, 1.0);
59 compare(slice.startAngle, 0.0);
60 compare(slice.value, 10.0);
61 }
62
63 function test_append() {
64 addedSpy.clear();
65 countChangedSpy.clear();
66 sumChangedSpy.clear();
67 var count = 50;
68 for (var i = 0; i < count; i++)
69 pieSeries.append("slice" + i, Math.random());
70 compare(addedSpy.count, count);
71 compare(countChangedSpy.count, count);
72 compare(sumChangedSpy.count, count);
73 pieSeries.clear();
74 }
75
76 function test_remove() {
77 removedSpy.clear();
78 countChangedSpy.clear();
79 sumChangedSpy.clear();
80 var count = 50;
81 for (var i = 0; i < count; i++)
82 pieSeries.append("slice" + i, Math.random());
83 for (var j = 0; j < count; j++)
84 pieSeries.remove(pieSeries.at(0));
85 compare(removedSpy.count, count);
86 compare(countChangedSpy.count, 2 * count);
87 compare(sumChangedSpy.count, 2 * count);
88 compare(pieSeries.count, 0);
89 }
90
91 function test_find() {
92 var count = 50;
93 for (var i = 0; i < count; i++)
94 pieSeries.append("slice" + i, Math.random());
95 for (var j = 0; j < count; j++)
96 compare(pieSeries.find("slice" + j).label, "slice" + j);
97 pieSeries.clear();
98 }
99 }
100
101 ChartView {
102 id: chartView
103 anchors.fill: parent
104
105 PieSeries {
106 id: pieSeries
107 name: "pie"
108
109 SignalSpy {
110 id: addedSpy
111 target: pieSeries
112 signalName: "added"
113 }
114 SignalSpy {
115 id: removedSpy
116 target: pieSeries
117 signalName: "removed"
118 }
119 SignalSpy {
120 id: sumChangedSpy
121 target: pieSeries
122 signalName: "sumChanged"
123 }
124 SignalSpy {
125 id: countChangedSpy
126 target: pieSeries
127 signalName: "countChanged"
128 }
129 }
130 }
131 }
@@ -0,0 +1,116
1 /****************************************************************************
2 **
3 ** Copyright (C) 2013 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 Enterprise Charts Add-on.
8 **
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise 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 import QtQuick 2.0
22 import QtTest 1.0
23 import QtCommercial.Chart 1.2
24
25 Rectangle {
26 width: 400
27 height: 300
28
29 TestCase {
30 id: tc1
31 name: "tst_qml-qtquicktest ValueAxis 1.2"
32 when: windowShown
33
34 // test functions are run in alphabetical order, the name has 'a' so that it
35 // will be the first function to execute.
36 function test_a_properties() {
37 // Default properties
38 verify(axisX.min < 0, "AxisX min");
39 verify(axisX.max > 0, "AxisX max");
40 verify(axisY.min < 0, "AxisY min");
41 verify(axisY.max > 0, "AxisY max");
42 verify(axisX.tickCount == 5, "AxisX tick count");
43 verify(axisY.tickCount == 5, "AxisY tick count");
44 verify(axisX.labelFormat == "", "label format");
45
46 // Modify properties
47 axisX.tickCount = 3;
48 verify(axisX.tickCount == 3, "set tick count");
49 }
50
51 function test_functions() {
52 // Set the axis ranges to not "nice" ones...
53 var min = 0.032456456;
54 var max = 10.67845634;
55 axisX.min = min;
56 axisX.max = max;
57 axisY.min = min;
58 axisY.max = max;
59
60 // ...And then apply nice numbers and verify the range was changed
61 axisX.applyNiceNumbers();
62 axisY.applyNiceNumbers();
63 verify(axisX.min != min);
64 verify(axisX.max != max);
65 verify(axisY.min != min);
66 verify(axisY.max != max);
67 }
68
69 function test_signals() {
70 minChangedSpy.clear();
71 maxChangedSpy.clear();
72 axisX.min = 2;
73 compare(minChangedSpy.count, 1, "onMinChanged");
74 compare(maxChangedSpy.count, 0, "onMaxChanged");
75
76 axisX.max = 8;
77 compare(minChangedSpy.count, 1, "onMinChanged");
78 compare(maxChangedSpy.count, 1, "onMaxChanged");
79
80 // restore original values
81 axisX.min = 0;
82 axisX.max = 10;
83 compare(minChangedSpy.count, 2, "onMinChanged");
84 compare(maxChangedSpy.count, 2, "onMaxChanged");
85 }
86 }
87
88 ChartView {
89 id: chartView
90 anchors.fill: parent
91
92 LineSeries {
93 id: lineSeries1
94 axisX: ValueAxis {
95 id: axisX
96 }
97 axisY: ValueAxis {
98 id: axisY
99 }
100 XYPoint { x: -1; y: -1 }
101 XYPoint { x: 0; y: 0 }
102 XYPoint { x: 5; y: 5 }
103 }
104
105 SignalSpy {
106 id: minChangedSpy
107 target: axisX
108 signalName: "minChanged"
109 }
110 SignalSpy {
111 id: maxChangedSpy
112 target: axisX
113 signalName: "maxChanged"
114 }
115 }
116 }
@@ -0,0 +1,260
1 /****************************************************************************
2 **
3 ** Copyright (C) 2013 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 Enterprise Charts Add-on.
8 **
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise 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 import QtQuick 2.0
22 import QtTest 1.0
23 import QtCommercial.Chart 1.2
24
25 Rectangle {
26 width: 400
27 height: 300
28
29 TestCase {
30 id: tc1
31 name: "tst_qml-qtquicktest XY Series 1.2"
32 when: windowShown
33
34 function test_properties() {
35 verify(lineSeries.color != undefined);
36 compare(lineSeries.pointsVisible, false);
37 compare(lineSeries.capStyle, Qt.SquareCap);
38 compare(lineSeries.style, Qt.SolidLine);
39 compare(lineSeries.width, 2.0);
40
41 verify(splineSeries.color != undefined);
42 compare(splineSeries.pointsVisible, false);
43 compare(splineSeries.capStyle, Qt.SquareCap);
44 compare(splineSeries.style, Qt.SolidLine);
45 compare(splineSeries.width, 2.0);
46
47 verify(scatterSeries.color != undefined);
48 verify(scatterSeries.borderColor != undefined);
49 compare(scatterSeries.borderWidth, 2.0);
50 compare(scatterSeries.markerShape, ScatterSeries.MarkerShapeCircle);
51 compare(scatterSeries.markerSize, 15.0);
52
53 verify(areaSeries.color != undefined);
54 verify(areaSeries.borderColor != undefined);
55 compare(areaSeries.borderWidth, 2.0);
56 }
57
58 function test_axes() {
59 // Axis initialization
60 compare(chartView.axisX(), lineSeries.axisX);
61 compare(chartView.axisY(), lineSeries.axisY);
62 compare(lineSeries.axisX, splineSeries.axisX);
63 compare(lineSeries.axisY, splineSeries.axisY);
64 compare(lineSeries.axisX, areaSeries.axisX);
65 compare(lineSeries.axisY, areaSeries.axisY);
66 }
67
68 function test_append() {
69 lineSeriesPointAddedSpy.clear();
70 splineSeriesPointAddedSpy.clear();
71 scatterSeriesPointAddedSpy.clear();
72 var count = append();
73 compare(lineSeries.count, count);
74 compare(splineSeries.count, count);
75 compare(scatterSeries.count, count);
76 compare(lineSeriesPointAddedSpy.count, count);
77 compare(splineSeriesPointAddedSpy.count, count);
78 compare(scatterSeriesPointAddedSpy.count, count);
79 clear();
80 compare(lineSeries.count, 0);
81 compare(splineSeries.count, 0);
82 compare(scatterSeries.count, 0);
83 }
84
85 function test_replace() {
86 var count = append();
87 for (var i = 0; i < count; i++) {
88 lineSeries.replace(lineSeries.at(i).x, lineSeries.at(i).y, i, Math.random());
89 splineSeries.replace(splineSeries.at(i).x, splineSeries.at(i).y, i, Math.random());
90 scatterSeries.replace(scatterSeries.at(i).x, scatterSeries.at(i).y, i, Math.random());
91 }
92 compare(lineSeries.count, count);
93 compare(splineSeries.count, count);
94 compare(scatterSeries.count, count);
95 compare(lineSeriesPointReplacedSpy.count, count);
96 compare(splineSeriesPointReplacedSpy.count, count);
97 compare(scatterSeriesPointReplacedSpy.count, count);
98 clear();
99 }
100
101 function test_insert() {
102 var count = append();
103 lineSeriesPointAddedSpy.clear();
104 splineSeriesPointAddedSpy.clear();
105 scatterSeriesPointAddedSpy.clear();
106 for (var i = 0; i < count; i++) {
107 lineSeries.insert(i * 2, i, Math.random());
108 splineSeries.insert(i * 2, i, Math.random());
109 scatterSeries.insert(i * 2, i, Math.random());
110 }
111 compare(lineSeries.count, count * 2);
112 compare(splineSeries.count, count * 2);
113 compare(scatterSeries.count, count * 2);
114 compare(lineSeriesPointAddedSpy.count, count);
115 compare(splineSeriesPointAddedSpy.count, count);
116 compare(scatterSeriesPointAddedSpy.count, count);
117 clear();
118 }
119
120 function test_remove() {
121 lineSeriesPointRemovedSpy.clear();
122 splineSeriesPointRemovedSpy.clear();
123 scatterSeriesPointRemovedSpy.clear();
124 var count = append();
125 for (var i = 0; i < count; i++) {
126 lineSeries.remove(lineSeries.at(0).x, lineSeries.at(0).y);
127 splineSeries.remove(splineSeries.at(0).x, splineSeries.at(0).y);
128 scatterSeries.remove(scatterSeries.at(0).x, scatterSeries.at(0).y);
129 }
130 compare(lineSeries.count, 0);
131 compare(splineSeries.count, 0);
132 compare(scatterSeries.count, 0);
133 compare(lineSeriesPointRemovedSpy.count, count);
134 compare(splineSeriesPointRemovedSpy.count, count);
135 compare(scatterSeriesPointRemovedSpy.count, count);
136 }
137
138 // Not a test function, called from test functions
139 function append() {
140 var count = 100;
141 chartView.axisX().min = 0;
142 chartView.axisX().max = 100;
143 chartView.axisY().min = 0;
144 chartView.axisY().max = 1;
145
146 for (var i = 0; i < count; i++) {
147 lineSeries.append(i, Math.random());
148 splineSeries.append(i, Math.random());
149 scatterSeries.append(i, Math.random());
150 }
151
152 return count;
153 }
154
155 // Not a test function, called from test functions
156 function clear() {
157 lineSeries.clear();
158 splineSeries.clear();
159 scatterSeries.clear();
160 }
161 }
162
163 ChartView {
164 id: chartView
165 anchors.fill: parent
166
167 LineSeries {
168 id: lineSeries
169 name: "line"
170
171 SignalSpy {
172 id: lineSeriesPointAddedSpy
173 target: lineSeries
174 signalName: "pointAdded"
175 }
176
177 SignalSpy {
178 id: lineSeriesPointReplacedSpy
179 target: lineSeries
180 signalName: "pointReplaced"
181 }
182
183 SignalSpy {
184 id: lineSeriesPointsReplacedSpy
185 target: lineSeries
186 signalName: "pointsReplaced"
187 }
188
189 SignalSpy {
190 id: lineSeriesPointRemovedSpy
191 target: lineSeries
192 signalName: "pointRemoved"
193 }
194 }
195
196 AreaSeries {
197 id: areaSeries
198 name: "area"
199 upperSeries: lineSeries
200 }
201
202 SplineSeries {
203 id: splineSeries
204 name: "spline"
205
206 SignalSpy {
207 id: splineSeriesPointAddedSpy
208 target: splineSeries
209 signalName: "pointAdded"
210 }
211
212 SignalSpy {
213 id: splineSeriesPointReplacedSpy
214 target: splineSeries
215 signalName: "pointReplaced"
216 }
217
218 SignalSpy {
219 id: splineSeriesPointsReplacedSpy
220 target: splineSeries
221 signalName: "pointsReplaced"
222 }
223
224 SignalSpy {
225 id: splineSeriesPointRemovedSpy
226 target: splineSeries
227 signalName: "pointRemoved"
228 }
229 }
230
231 ScatterSeries {
232 id: scatterSeries
233 name: "scatter"
234
235 SignalSpy {
236 id: scatterSeriesPointAddedSpy
237 target: scatterSeries
238 signalName: "pointAdded"
239 }
240
241 SignalSpy {
242 id: scatterSeriesPointReplacedSpy
243 target: scatterSeries
244 signalName: "pointReplaced"
245 }
246
247 SignalSpy {
248 id: scatterSeriesPointsReplacedSpy
249 target: scatterSeries
250 signalName: "pointsReplaced"
251 }
252
253 SignalSpy {
254 id: scatterSeriesPointRemovedSpy
255 target: scatterSeries
256 signalName: "pointRemoved"
257 }
258 }
259 }
260 }
@@ -1,22 +1,28
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2013 Digia Plc
3 ** Copyright (C) 2013 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Enterprise Charts Add-on.
7 ** This file is part of the Qt Enterprise Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise License Agreement provided with the
11 ** accordance with the Qt Enterprise License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 #include <QtQuickTest/quicktest.h>
21 #include <QtQuickTest/quicktest.h>
22 QUICK_TEST_MAIN(example)
22 #include <QtWidgets/QApplication>
23
24 int main(int argc, char *argv[])
25 {
26 QApplication app(argc, argv);
27 return quick_test_main(argc, argv, "example", QUICK_TEST_SOURCE_DIR);
28 }
@@ -1,8 +1,13
1 !include( ../auto.pri ) {
1 !include( ../auto.pri ) {
2 error( "Couldn't find the auto.pri file!" )
2 error( "Couldn't find the auto.pri file!" )
3 }
3 }
4
4
5 TEMPLATE = app
5 greaterThan(QT_MAJOR_VERSION, 4) {
6 CONFIG += warn_on qmltestcase
6 TEMPLATE = app
7 SOURCES += main.cpp
7 CONFIG += warn_on qmltestcase
8 DEFINES += QUICK_TEST_SOURCE_DIR=\"\\\"$$PWD\\\"\"
8 SOURCES += main.cpp
9 OTHER_FILES += tst_*.qml
10 DEFINES += QUICK_TEST_SOURCE_DIR=\"\\\"$$PWD\\\"\"
11 } else {
12 error("These auto tests are designed for Qt5 / QtQuick 2.0")
13 }
@@ -1,87 +1,107
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2013 Digia Plc
3 ** Copyright (C) 2013 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Enterprise Charts Add-on.
7 ** This file is part of the Qt Enterprise Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise License Agreement provided with the
11 ** accordance with the Qt Enterprise License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 import QtQuick 1.0
21 import QtQuick 2.0
22 import QtQuickTest 1.0
22 import QtTest 1.0
23 import QtCommercial.Chart 1.2
23 import QtCommercial.Chart 1.3
24
24
25 Rectangle {
25 Rectangle {
26 width: 400
26 width: 400
27 height: 300
27 height: 300
28
28
29 TestCase {
29 TestCase {
30 id: tc1
30 id: tc1
31 name: "tst_qml-qtquicktest BarCategoryAxis"
31 name: "tst_qml-qtquicktest BarCategoryAxis"
32 when: windowShown
32 when: windowShown
33
33
34 function test_minMax() {
34 function test_minMax() {
35 compare(barSeries1.axisX.min, "Jan", "AxisX min");
35 compare(barSeries1.axisX.min, "Jan", "AxisX min");
36 compare(barSeries1.axisX.max, "Jun", "AxisX max");
36 compare(barSeries1.axisX.max, "Jun", "AxisX max");
37 compare(barSeries1.axisY.min, 0, "AxisY min");
37 compare(barSeries1.axisY.min, 0, "AxisY min");
38 compare(barSeries1.axisY.max, 10, "AxisY max");
38 compare(barSeries1.axisY.max, 10, "AxisY max");
39 }
39 }
40
40
41 function test_categories() {
41 function test_categories() {
42 compare(barSeries1.axisX.count, 6, "AxisX count");
42 compare(barSeries1.axisX.count, 6, "AxisX count");
43 categoriesCountChangedSpy.clear();
44 categoriesChangedSpy.clear();
43
45
44 // Replace categories
46 // Replace categories
45 var cat = barSeries1.axisX.categories;
46 barSeries1.axisX.categories = ["Tam", "Hel", "Maa", "Huh"];
47 barSeries1.axisX.categories = ["Tam", "Hel", "Maa", "Huh"];
47 compare(barSeries1.axisX.count, 4, "AxisX count");
48 compare(barSeries1.axisX.count, 4, "AxisX count");
48 compare(categoriesCountChangedSpy.count, 1, "onCountChanged");
49 compare(categoriesCountChangedSpy.count, 1, "onCountChanged");
49 compare(categoriesChangedSpy.count, 1, "onCategoriesChanged");
50 compare(categoriesChangedSpy.count, 1, "onCategoriesChanged");
50
51
51 // Reset the original categories
52 // Reset the original categories
52 barSeries1.axisX.categories = cat;
53 barSeries1.axisX.categories = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"]
53 compare(barSeries1.axisX.count, 6, "AxisX count");
54 compare(barSeries1.axisX.count, 6, "AxisX count");
54 compare(categoriesCountChangedSpy.count, 2, "onCountChanged");
55 compare(categoriesCountChangedSpy.count, 2, "onCountChanged");
55 compare(categoriesChangedSpy.count, 2, "onCategoriesChanged");
56 compare(categoriesChangedSpy.count, 2, "onCategoriesChanged");
56 }
57 }
58
59 function test_minMaxChanged() {
60 axisY.min = -1;
61 compare(minChangedSpy.count, 1, "onMinChanged");
62 compare(maxChangedSpy.count, 0, "onMaxChanged");
63 axisY.max = 12;
64 compare(minChangedSpy.count, 1, "onMinChanged");
65 compare(maxChangedSpy.count, 1, "onMaxChanged");
66 }
57 }
67 }
58
68
59 ChartView {
69 ChartView {
60 id: chartView
70 id: chartView
61 anchors.fill: parent
71 anchors.fill: parent
62
72
63 BarSeries {
73 BarSeries {
64 id: barSeries1
74 id: barSeries1
65 axisX: BarCategoryAxis {
75 axisX: BarCategoryAxis {
66 id: axisX
76 id: axisX
67 categories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun" ]
77 categories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun" ]
68 }
78 }
69 axisY: ValuesAxis {
79 axisY: ValuesAxis {
70 id: axisY
80 id: axisY
71 min: 0
81 min: 0
72 max: 10
82 max: 10
73 }
83 }
74 }
84 }
75
85
76 SignalSpy {
86 SignalSpy {
77 id: categoriesCountChangedSpy
87 id: categoriesCountChangedSpy
78 target: axisX
88 target: axisX
79 signalName: "countChanged"
89 signalName: "countChanged"
80 }
90 }
81 SignalSpy {
91 SignalSpy {
82 id: categoriesChangedSpy
92 id: categoriesChangedSpy
83 target: axisX
93 target: axisX
84 signalName: "categoriesChanged"
94 signalName: "categoriesChanged"
85 }
95 }
96 SignalSpy {
97 id: minChangedSpy
98 target: axisY
99 signalName: "minChanged"
100 }
101 SignalSpy {
102 id: maxChangedSpy
103 target: axisY
104 signalName: "maxChanged"
105 }
86 }
106 }
87 }
107 }
@@ -1,87 +1,107
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2013 Digia Plc
3 ** Copyright (C) 2013 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Enterprise Charts Add-on.
7 ** This file is part of the Qt Enterprise Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise License Agreement provided with the
11 ** accordance with the Qt Enterprise License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 import QtQuick 1.0
21 import QtQuick 2.0
22 import QtQuickTest 1.0
22 import QtTest 1.0
23 import QtCommercial.Chart 1.1
23 import QtCommercial.Chart 1.1
24
24
25 Rectangle {
25 Rectangle {
26 width: 400
26 width: 400
27 height: 300
27 height: 300
28
28
29 TestCase {
29 TestCase {
30 id: tc1
30 id: tc1
31 name: "tst_qml-qtquicktest BarCategoryAxis 1.1"
31 name: "tst_qml-qtquicktest BarCategoryAxis 1.1"
32 when: windowShown
32 when: windowShown
33
33
34 function test_minMax() {
34 function test_minMax() {
35 compare(barSeries1.axisX.min, "Jan", "AxisX min");
35 compare(barSeries1.axisX.min, "Jan", "AxisX min");
36 compare(barSeries1.axisX.max, "Jun", "AxisX max");
36 compare(barSeries1.axisX.max, "Jun", "AxisX max");
37 compare(barSeries1.axisY.min, 0, "AxisY min");
37 compare(barSeries1.axisY.min, 0, "AxisY min");
38 compare(barSeries1.axisY.max, 10, "AxisY max");
38 compare(barSeries1.axisY.max, 10, "AxisY max");
39 }
39 }
40
40
41 function test_categories() {
41 function test_categories() {
42 compare(barSeries1.axisX.count, 6, "AxisX count");
42 compare(barSeries1.axisX.count, 6, "AxisX count");
43 categoriesCountChangedSpy.clear();
44 categoriesChangedSpy.clear();
43
45
44 // Replace categories
46 // Replace categories
45 var cat = barSeries1.axisX.categories;
46 barSeries1.axisX.categories = ["Tam", "Hel", "Maa", "Huh"];
47 barSeries1.axisX.categories = ["Tam", "Hel", "Maa", "Huh"];
47 compare(barSeries1.axisX.count, 4, "AxisX count");
48 compare(barSeries1.axisX.count, 4, "AxisX count");
48 compare(categoriesCountChangedSpy.count, 1, "onCountChanged");
49 compare(categoriesCountChangedSpy.count, 1, "onCountChanged");
49 compare(categoriesChangedSpy.count, 1, "onCategoriesChanged");
50 compare(categoriesChangedSpy.count, 1, "onCategoriesChanged");
50
51
51 // Reset the original categories
52 // Reset the original categories
52 barSeries1.axisX.categories = cat;
53 barSeries1.axisX.categories = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"]
53 compare(barSeries1.axisX.count, 6, "AxisX count");
54 compare(barSeries1.axisX.count, 6, "AxisX count");
54 compare(categoriesCountChangedSpy.count, 2, "onCountChanged");
55 compare(categoriesCountChangedSpy.count, 2, "onCountChanged");
55 compare(categoriesChangedSpy.count, 2, "onCategoriesChanged");
56 compare(categoriesChangedSpy.count, 2, "onCategoriesChanged");
56 }
57 }
58
59 function test_minMaxChanged() {
60 axisY.min = -1;
61 compare(minChangedSpy.count, 1, "onMinChanged");
62 compare(maxChangedSpy.count, 0, "onMaxChanged");
63 axisY.max = 12;
64 compare(minChangedSpy.count, 1, "onMinChanged");
65 compare(maxChangedSpy.count, 1, "onMaxChanged");
66 }
57 }
67 }
58
68
59 ChartView {
69 ChartView {
60 id: chartView
70 id: chartView
61 anchors.fill: parent
71 anchors.fill: parent
62
72
63 BarSeries {
73 BarSeries {
64 id: barSeries1
74 id: barSeries1
65 axisX: BarCategoryAxis {
75 axisX: BarCategoryAxis {
66 id: axisX
76 id: axisX
67 categories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun" ]
77 categories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun" ]
68 }
78 }
69 axisY: ValuesAxis {
79 axisY: ValuesAxis {
70 id: axisY
80 id: axisY
71 min: 0
81 min: 0
72 max: 10
82 max: 10
73 }
83 }
74 }
84 }
75
85
76 SignalSpy {
86 SignalSpy {
77 id: categoriesCountChangedSpy
87 id: categoriesCountChangedSpy
78 target: axisX
88 target: axisX
79 signalName: "countChanged"
89 signalName: "countChanged"
80 }
90 }
81 SignalSpy {
91 SignalSpy {
82 id: categoriesChangedSpy
92 id: categoriesChangedSpy
83 target: axisX
93 target: axisX
84 signalName: "categoriesChanged"
94 signalName: "categoriesChanged"
85 }
95 }
96 SignalSpy {
97 id: minChangedSpy
98 target: axisY
99 signalName: "minChanged"
100 }
101 SignalSpy {
102 id: maxChangedSpy
103 target: axisY
104 signalName: "maxChanged"
105 }
86 }
106 }
87 }
107 }
@@ -1,147 +1,146
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2013 Digia Plc
3 ** Copyright (C) 2013 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Enterprise Charts Add-on.
7 ** This file is part of the Qt Enterprise Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise License Agreement provided with the
11 ** accordance with the Qt Enterprise License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 import QtQuick 1.0
21 import QtQuick 2.0
22 import QtQuickTest 1.0
22 import QtTest 1.0
23 import QtCommercial.Chart 1.2
23 import QtCommercial.Chart 1.3
24
24
25 Rectangle {
25 Rectangle {
26 width: 400
26 width: 400
27 height: 300
27 height: 300
28
28
29 TestCase {
29 TestCase {
30 id: tc1
30 id: tc1
31 name: "tst_qml-qtquicktest BarSeries"
31 name: "tst_qml-qtquicktest BarSeries"
32 when: windowShown
32 when: windowShown
33
33
34 function test_properties() {
34 function test_properties() {
35 compare(barSeries.barWidth, 0.5);
35 compare(barSeries.barWidth, 0.5);
36 compare(barSeries.labelsVisible, false);
36 compare(barSeries.labelsVisible, false);
37 }
37 }
38
38
39 function test_axes() {
39 function test_axes() {
40 compare(chartView.axes.length, 2);
40 verify(chartView.axisX() == barSeries.axisX);
41 verify(chartView.axes[0] == barSeries.axisX || chartView.axes[1] == barSeries.axisX);
41 verify(chartView.axisY() == barSeries.axisY);
42 verify(chartView.axes[0] == barSeries.axisY || chartView.axes[1] == barSeries.axisY);
43
42
44 compare(barSeries.axisX, stackedBarSeries.axisX);
43 compare(barSeries.axisX, stackedBarSeries.axisX);
45 compare(barSeries.axisY, stackedBarSeries.axisY);
44 compare(barSeries.axisY, stackedBarSeries.axisY);
46
45
47 compare(barSeries.axisX, percentBarSeries.axisX);
46 compare(barSeries.axisX, percentBarSeries.axisX);
48 compare(barSeries.axisY, percentBarSeries.axisY);
47 compare(barSeries.axisY, percentBarSeries.axisY);
49 }
48 }
50
49
51 function test_append() {
50 function test_append() {
52 var setCount = 5;
51 var setCount = 5;
53 var valueCount = 50;
52 var valueCount = 50;
54 addedSpy.clear();
53 addedSpy.clear();
55 append(setCount, valueCount);
54 append(setCount, valueCount);
56
55
57 compare(barSeries.count, setCount);
56 compare(barSeries.count, setCount);
58 for (var k = 0; k < setCount; k++) {
57 for (var k = 0; k < setCount; k++) {
59 compare(barSeries.at(k).count, valueCount);
58 compare(barSeries.at(k).count, valueCount);
60 compare(barSeries.at(k).label, "barset" + k);
59 compare(barSeries.at(k).label, "barset" + k);
61 }
60 }
62 compare(addedSpy.count, setCount);
61 compare(addedSpy.count, setCount);
63
62
64 barSeries.clear();
63 barSeries.clear();
65 compare(barSeries.count, 0);
64 compare(barSeries.count, 0);
66 }
65 }
67
66
68 function test_insert() {
67 function test_insert() {
69 var setCount = 5;
68 var setCount = 5;
70 var valueCount = 50;
69 var valueCount = 50;
71 addedSpy.clear();
70 addedSpy.clear();
72 append(setCount, valueCount);
71 append(setCount, valueCount);
73
72
74 for (var i = 0; i < setCount; i++) {
73 for (var i = 0; i < setCount; i++) {
75 var values = [];
74 var values = [];
76 for (var j = 0; j < valueCount; j++)
75 for (var j = 0; j < valueCount; j++)
77 values[j] = Math.random() * 10;
76 values[j] = Math.random() * 10;
78 var set = barSeries.insert(i, "barset" + i, values);
77 var set = barSeries.insert(i, "barset" + i, values);
79 compare(set.label, "barset" + i);
78 compare(set.label, "barset" + i);
80 }
79 }
81
80
82 compare(barSeries.count, setCount * 2);
81 compare(barSeries.count, setCount * 2);
83 for (var k = 0; k < setCount * 2; k++)
82 for (var k = 0; k < setCount * 2; k++)
84 compare(barSeries.at(k).count, valueCount);
83 compare(barSeries.at(k).count, valueCount);
85 compare(addedSpy.count, 2 * setCount);
84 compare(addedSpy.count, 2 * setCount);
86
85
87 barSeries.clear();
86 barSeries.clear();
88 compare(barSeries.count, 0);
87 compare(barSeries.count, 0);
89 }
88 }
90
89
91 function test_remove() {
90 function test_remove() {
92 var setCount = 5;
91 var setCount = 5;
93 var valueCount = 50;
92 var valueCount = 50;
94 removedSpy.clear();
93 removedSpy.clear();
95 append(setCount, valueCount);
94 append(setCount, valueCount);
96
95
97 for (var k = 0; k < setCount; k++)
96 for (var k = 0; k < setCount; k++)
98 barSeries.remove(barSeries.at(0));
97 barSeries.remove(barSeries.at(0));
99
98
100 compare(barSeries.count, 0);
99 compare(barSeries.count, 0);
101 compare(removedSpy.count, setCount);
100 compare(removedSpy.count, setCount);
102 }
101 }
103
102
104 // Not a test function, used by one or more test functions
103 // Not a test function, used by one or more test functions
105 function append(setCount, valueCount) {
104 function append(setCount, valueCount) {
106 for (var i = 0; i < setCount; i++) {
105 for (var i = 0; i < setCount; i++) {
107 var values = [];
106 var values = [];
108 for (var j = 0; j < valueCount; j++)
107 for (var j = 0; j < valueCount; j++)
109 values[j] = Math.random() * 10;
108 values[j] = Math.random() * 10;
110 barSeries.append("barset" + i, values);
109 barSeries.append("barset" + i, values);
111 }
110 }
112 }
111 }
113 }
112 }
114
113
115 ChartView {
114 ChartView {
116 id: chartView
115 id: chartView
117 anchors.fill: parent
116 anchors.fill: parent
118
117
119 BarSeries {
118 BarSeries {
120 id: barSeries
119 id: barSeries
121 name: "bar"
120 name: "bar"
122 axisX: BarCategoryAxis {}
121 axisX: BarCategoryAxis {}
123 axisY: ValueAxis { min: 0; max: 10 }
122 axisY: ValueAxis { min: 0; max: 10 }
124
123
125 SignalSpy {
124 SignalSpy {
126 id: addedSpy
125 id: addedSpy
127 target: barSeries
126 target: barSeries
128 signalName: "barsetsAdded"
127 signalName: "barsetsAdded"
129 }
128 }
130 SignalSpy {
129 SignalSpy {
131 id: removedSpy
130 id: removedSpy
132 target: barSeries
131 target: barSeries
133 signalName: "barsetsRemoved"
132 signalName: "barsetsRemoved"
134 }
133 }
135 }
134 }
136
135
137 StackedBarSeries {
136 StackedBarSeries {
138 id: stackedBarSeries
137 id: stackedBarSeries
139 name: "stackedBar"
138 name: "stackedBar"
140 }
139 }
141
140
142 PercentBarSeries {
141 PercentBarSeries {
143 id: percentBarSeries
142 id: percentBarSeries
144 name: "percentBar"
143 name: "percentBar"
145 }
144 }
146 }
145 }
147 }
146 }
@@ -1,125 +1,125
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2013 Digia Plc
3 ** Copyright (C) 2013 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Enterprise Charts Add-on.
7 ** This file is part of the Qt Enterprise Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise License Agreement provided with the
11 ** accordance with the Qt Enterprise License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 import QtQuick 1.0
21 import QtQuick 2.0
22 import QtQuickTest 1.0
22 import QtTest 1.0
23 import QtCommercial.Chart 1.1
23 import QtCommercial.Chart 1.1
24
24
25 Rectangle {
25 Rectangle {
26 width: 400
26 width: 400
27 height: 300
27 height: 300
28
28
29 TestCase {
29 TestCase {
30 id: tc1
30 id: tc1
31 name: "tst_qml-qtquicktest BarSeries 1.1"
31 name: "tst_qml-qtquicktest BarSeries 1.1"
32 when: windowShown
32 when: windowShown
33
33
34 function test_properties() {
34 function test_properties() {
35 compare(barSeries.barWidth, 0.5);
35 compare(barSeries.barWidth, 0.5);
36 compare(barSeries.labelsVisible, false);
36 compare(barSeries.labelsVisible, false);
37 }
37 }
38
38
39 function test_append() {
39 function test_append() {
40 var setCount = 5;
40 var setCount = 5;
41 var valueCount = 50;
41 var valueCount = 50;
42 addedSpy.clear();
42 addedSpy.clear();
43 append(setCount, valueCount);
43 append(setCount, valueCount);
44
44
45 compare(barSeries.count, setCount);
45 compare(barSeries.count, setCount);
46 for (var k = 0; k < setCount; k++) {
46 for (var k = 0; k < setCount; k++) {
47 compare(barSeries.at(k).count, valueCount);
47 compare(barSeries.at(k).count, valueCount);
48 compare(barSeries.at(k).label, "barset" + k);
48 compare(barSeries.at(k).label, "barset" + k);
49 }
49 }
50 compare(addedSpy.count, setCount);
50 compare(addedSpy.count, setCount);
51
51
52 barSeries.clear();
52 barSeries.clear();
53 compare(barSeries.count, 0);
53 compare(barSeries.count, 0);
54 }
54 }
55
55
56 function test_insert() {
56 function test_insert() {
57 var setCount = 5;
57 var setCount = 5;
58 var valueCount = 50;
58 var valueCount = 50;
59 addedSpy.clear();
59 addedSpy.clear();
60 append(setCount, valueCount);
60 append(setCount, valueCount);
61
61
62 for (var i = 0; i < setCount; i++) {
62 for (var i = 0; i < setCount; i++) {
63 var values = [];
63 var values = [];
64 for (var j = 0; j < valueCount; j++)
64 for (var j = 0; j < valueCount; j++)
65 values[j] = Math.random() * 10;
65 values[j] = Math.random() * 10;
66 var set = barSeries.insert(i, "barset" + i, values);
66 var set = barSeries.insert(i, "barset" + i, values);
67 compare(set.label, "barset" + i);
67 compare(set.label, "barset" + i);
68 }
68 }
69
69
70 compare(barSeries.count, setCount * 2);
70 compare(barSeries.count, setCount * 2);
71 for (var k = 0; k < setCount * 2; k++)
71 for (var k = 0; k < setCount * 2; k++)
72 compare(barSeries.at(k).count, valueCount);
72 compare(barSeries.at(k).count, valueCount);
73 compare(addedSpy.count, 2 * setCount);
73 compare(addedSpy.count, 2 * setCount);
74
74
75 barSeries.clear();
75 barSeries.clear();
76 compare(barSeries.count, 0);
76 compare(barSeries.count, 0);
77 }
77 }
78
78
79 function test_remove() {
79 function test_remove() {
80 var setCount = 5;
80 var setCount = 5;
81 var valueCount = 50;
81 var valueCount = 50;
82 removedSpy.clear();
82 removedSpy.clear();
83 append(setCount, valueCount);
83 append(setCount, valueCount);
84
84
85 for (var k = 0; k < setCount; k++)
85 for (var k = 0; k < setCount; k++)
86 barSeries.remove(barSeries.at(0));
86 barSeries.remove(barSeries.at(0));
87
87
88 compare(barSeries.count, 0);
88 compare(barSeries.count, 0);
89 compare(removedSpy.count, setCount);
89 compare(removedSpy.count, setCount);
90 }
90 }
91
91
92 // Not a test function, used by one or more test functions
92 // Not a test function, used by one or more test functions
93 function append(setCount, valueCount) {
93 function append(setCount, valueCount) {
94 for (var i = 0; i < setCount; i++) {
94 for (var i = 0; i < setCount; i++) {
95 var values = [];
95 var values = [];
96 for (var j = 0; j < valueCount; j++)
96 for (var j = 0; j < valueCount; j++)
97 values[j] = Math.random() * 10;
97 values[j] = Math.random() * 10;
98 barSeries.append("barset" + i, values);
98 barSeries.append("barset" + i, values);
99 }
99 }
100 }
100 }
101 }
101 }
102
102
103 ChartView {
103 ChartView {
104 id: chartView
104 id: chartView
105 anchors.fill: parent
105 anchors.fill: parent
106
106
107 BarSeries {
107 BarSeries {
108 axisX: BarCategoriesAxis {}
108 axisX: BarCategoriesAxis {}
109 axisY: ValuesAxis { min: 0; max: 10 }
109 axisY: ValuesAxis { min: 0; max: 10 }
110 id: barSeries
110 id: barSeries
111 name: "bar"
111 name: "bar"
112
112
113 SignalSpy {
113 SignalSpy {
114 id: addedSpy
114 id: addedSpy
115 target: barSeries
115 target: barSeries
116 signalName: "barsetsAdded"
116 signalName: "barsetsAdded"
117 }
117 }
118 SignalSpy {
118 SignalSpy {
119 id: removedSpy
119 id: removedSpy
120 target: barSeries
120 target: barSeries
121 signalName: "barsetsRemoved"
121 signalName: "barsetsRemoved"
122 }
122 }
123 }
123 }
124 }
124 }
125 }
125 }
@@ -1,84 +1,84
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2013 Digia Plc
3 ** Copyright (C) 2013 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Enterprise Charts Add-on.
7 ** This file is part of the Qt Enterprise Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise License Agreement provided with the
11 ** accordance with the Qt Enterprise License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 import QtQuick 1.0
21 import QtQuick 2.0
22 import QtQuickTest 1.0
22 import QtTest 1.0
23 import QtCommercial.Chart 1.2
23 import QtCommercial.Chart 1.3
24
24
25 Rectangle {
25 Rectangle {
26 width: 400
26 width: 400
27 height: 300
27 height: 300
28
28
29 TestCase {
29 TestCase {
30 id: tc1
30 id: tc1
31 name: "tst_qml-qtquicktest CategoryAxis"
31 name: "tst_qml-qtquicktest CategoryAxis"
32 when: windowShown
32 when: windowShown
33
33
34 function test_minMax() {
34 function test_minMax() {
35 compare(lineSeries1.axisX.min, 0, "AxisX min");
35 compare(lineSeries1.axisX.min, 0, "AxisX min");
36 compare(lineSeries1.axisX.max, 10, "AxisX max");
36 compare(lineSeries1.axisX.max, 10, "AxisX max");
37 compare(lineSeries1.axisY.min, 0, "AxisY min");
37 compare(lineSeries1.axisY.min, 0, "AxisY min");
38 compare(lineSeries1.axisY.max, 10, "AxisY max");
38 compare(lineSeries1.axisY.max, 10, "AxisY max");
39 }
39 }
40
40
41 function test_categories() {
41 function test_categories() {
42 compare(lineSeries1.axisY.startValue, 0, "AxisY start value");
42 compare(lineSeries1.axisY.startValue, 0, "AxisY start value");
43 compare(lineSeries1.axisY.count, 3, "AxisY count");
43 compare(lineSeries1.axisY.count, 3, "AxisY count");
44 compare(lineSeries1.axisY.categoriesLabels[0], "label0", "AxisY categories labels");
44 compare(lineSeries1.axisY.categoriesLabels[0], "label0", "AxisY categories labels");
45 compare(lineSeries1.axisY.categoriesLabels[1], "label1", "AxisY categories labels");
45 compare(lineSeries1.axisY.categoriesLabels[1], "label1", "AxisY categories labels");
46 compare(lineSeries1.axisY.categoriesLabels[2], "label2", "AxisY categories labels");
46 compare(lineSeries1.axisY.categoriesLabels[2], "label2", "AxisY categories labels");
47 }
47 }
48 }
48 }
49
49
50 ChartView {
50 ChartView {
51 id: chartView
51 id: chartView
52 anchors.fill: parent
52 anchors.fill: parent
53
53
54 LineSeries {
54 LineSeries {
55 id: lineSeries1
55 id: lineSeries1
56 axisX: ValuesAxis {
56 axisX: ValuesAxis {
57 id: axisX
57 id: axisX
58 min: 0
58 min: 0
59 max: 10
59 max: 10
60 }
60 }
61 axisY: CategoryAxis {
61 axisY: CategoryAxis {
62 id: axisY
62 id: axisY
63 min: 0
63 min: 0
64 max: 10
64 max: 10
65 startValue: 0
65 startValue: 0
66 CategoryRange {
66 CategoryRange {
67 label: "label0"
67 label: "label0"
68 endValue: 1
68 endValue: 1
69 }
69 }
70 CategoryRange {
70 CategoryRange {
71 label: "label1"
71 label: "label1"
72 endValue: 3
72 endValue: 3
73 }
73 }
74 CategoryRange {
74 CategoryRange {
75 label: "label2"
75 label: "label2"
76 endValue: 10
76 endValue: 10
77 }
77 }
78 }
78 }
79 XYPoint { x: -1; y: -1 }
79 XYPoint { x: -1; y: -1 }
80 XYPoint { x: 0; y: 0 }
80 XYPoint { x: 0; y: 0 }
81 XYPoint { x: 5; y: 5 }
81 XYPoint { x: 5; y: 5 }
82 }
82 }
83 }
83 }
84 }
84 }
@@ -1,84 +1,84
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2013 Digia Plc
3 ** Copyright (C) 2013 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Enterprise Charts Add-on.
7 ** This file is part of the Qt Enterprise Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise License Agreement provided with the
11 ** accordance with the Qt Enterprise License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 import QtQuick 1.0
21 import QtQuick 2.0
22 import QtQuickTest 1.0
22 import QtTest 1.0
23 import QtCommercial.Chart 1.1
23 import QtCommercial.Chart 1.1
24
24
25 Rectangle {
25 Rectangle {
26 width: 400
26 width: 400
27 height: 300
27 height: 300
28
28
29 TestCase {
29 TestCase {
30 id: tc1
30 id: tc1
31 name: "tst_qml-qtquicktest CategoryAxis 1.1"
31 name: "tst_qml-qtquicktest CategoryAxis 1.1"
32 when: windowShown
32 when: windowShown
33
33
34 function test_minMax() {
34 function test_minMax() {
35 compare(lineSeries1.axisX.min, 0, "AxisX min");
35 compare(lineSeries1.axisX.min, 0, "AxisX min");
36 compare(lineSeries1.axisX.max, 10, "AxisX max");
36 compare(lineSeries1.axisX.max, 10, "AxisX max");
37 compare(lineSeries1.axisY.min, 0, "AxisY min");
37 compare(lineSeries1.axisY.min, 0, "AxisY min");
38 compare(lineSeries1.axisY.max, 10, "AxisY max");
38 compare(lineSeries1.axisY.max, 10, "AxisY max");
39 }
39 }
40
40
41 function test_categories() {
41 function test_categories() {
42 compare(lineSeries1.axisY.startValue, 0, "AxisY start value");
42 compare(lineSeries1.axisY.startValue, 0, "AxisY start value");
43 compare(lineSeries1.axisY.count, 3, "AxisY count");
43 compare(lineSeries1.axisY.count, 3, "AxisY count");
44 compare(lineSeries1.axisY.categoriesLabels[0], "label0", "AxisY categories labels");
44 compare(lineSeries1.axisY.categoriesLabels[0], "label0", "AxisY categories labels");
45 compare(lineSeries1.axisY.categoriesLabels[1], "label1", "AxisY categories labels");
45 compare(lineSeries1.axisY.categoriesLabels[1], "label1", "AxisY categories labels");
46 compare(lineSeries1.axisY.categoriesLabels[2], "label2", "AxisY categories labels");
46 compare(lineSeries1.axisY.categoriesLabels[2], "label2", "AxisY categories labels");
47 }
47 }
48 }
48 }
49
49
50 ChartView {
50 ChartView {
51 id: chartView
51 id: chartView
52 anchors.fill: parent
52 anchors.fill: parent
53
53
54 LineSeries {
54 LineSeries {
55 id: lineSeries1
55 id: lineSeries1
56 axisX: ValuesAxis {
56 axisX: ValuesAxis {
57 id: axisX
57 id: axisX
58 min: 0
58 min: 0
59 max: 10
59 max: 10
60 }
60 }
61 axisY: CategoryAxis {
61 axisY: CategoryAxis {
62 id: axisY
62 id: axisY
63 min: 0
63 min: 0
64 max: 10
64 max: 10
65 startValue: 0
65 startValue: 0
66 CategoryRange {
66 CategoryRange {
67 label: "label0"
67 label: "label0"
68 endValue: 1
68 endValue: 1
69 }
69 }
70 CategoryRange {
70 CategoryRange {
71 label: "label1"
71 label: "label1"
72 endValue: 3
72 endValue: 3
73 }
73 }
74 CategoryRange {
74 CategoryRange {
75 label: "label2"
75 label: "label2"
76 endValue: 10
76 endValue: 10
77 }
77 }
78 }
78 }
79 XYPoint { x: -1; y: -1 }
79 XYPoint { x: -1; y: -1 }
80 XYPoint { x: 0; y: 0 }
80 XYPoint { x: 0; y: 0 }
81 XYPoint { x: 5; y: 5 }
81 XYPoint { x: 5; y: 5 }
82 }
82 }
83 }
83 }
84 }
84 }
@@ -1,84 +1,79
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2013 Digia Plc
3 ** Copyright (C) 2013 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Enterprise Charts Add-on.
7 ** This file is part of the Qt Enterprise Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise License Agreement provided with the
11 ** accordance with the Qt Enterprise License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 import QtQuick 1.0
21 import QtQuick 2.0
22 import QtQuickTest 1.0
22 import QtTest 1.0
23 import QtCommercial.Chart 1.2
23 import QtCommercial.Chart 1.3
24
24
25 Rectangle {
25 Rectangle {
26 width: 400
26 width: 400
27 height: 300
27 height: 300
28
28
29 TestCase {
29 TestCase {
30 id: tc1
30 id: tc1
31 name: "tst_qml-qtquicktest ChartView Properties"
31 name: "tst_qml-qtquicktest ChartView Properties"
32 when: windowShown
32 when: windowShown
33
33
34 function test_chartViewProperties() {
34 function test_chartViewProperties() {
35 compare(chartView.animationOptions, ChartView.NoAnimation, "ChartView.animationOptions");
35 compare(chartView.animationOptions, ChartView.NoAnimation, "ChartView.animationOptions");
36 verify(chartView.backgroundColor != undefined);
36 verify(chartView.backgroundColor != undefined);
37 verify(chartView.bottomMargin > 0, "ChartView.bottomMargin");
38 verify(chartView.topMargin > 0, "ChartView.topMargin");
39 verify(chartView.leftMargin > 0, "ChartView.leftMargin");
40 verify(chartView.rightMargin > 0, "ChartView.rightMargin");
41 verify(chartView.margins.bottom > 0, "ChartView.margins.bottom");
37 verify(chartView.margins.bottom > 0, "ChartView.margins.bottom");
42 verify(chartView.margins.top > 0, "ChartView.margins.top");
38 verify(chartView.margins.top > 0, "ChartView.margins.top");
43 verify(chartView.margins.left > 0, "ChartView.margins.left");
39 verify(chartView.margins.left > 0, "ChartView.margins.left");
44 verify(chartView.margins.right > 0, "ChartView.margins.right");
40 verify(chartView.margins.right > 0, "ChartView.margins.right");
45 compare(chartView.count, 0, "ChartView.count");
41 compare(chartView.count, 0, "ChartView.count");
46 compare(chartView.dropShadowEnabled, false, "ChartView.dropShadowEnabled");
42 compare(chartView.dropShadowEnabled, false, "ChartView.dropShadowEnabled");
47 verify(chartView.plotArea.height > 0, "ChartView.plotArea.height");
43 verify(chartView.plotArea.height > 0, "ChartView.plotArea.height");
48 verify(chartView.plotArea.width > 0, "ChartView.plotArea.width");
44 verify(chartView.plotArea.width > 0, "ChartView.plotArea.width");
49 verify(chartView.plotArea.x > 0, "ChartView.plotArea.x");
45 verify(chartView.plotArea.x > 0, "ChartView.plotArea.x");
50 verify(chartView.plotArea.y > 0, "ChartView.plotArea.y");
46 verify(chartView.plotArea.y > 0, "ChartView.plotArea.y");
51 compare(chartView.theme, ChartView.ChartThemeLight, "ChartView.theme");
47 compare(chartView.theme, ChartView.ChartThemeLight, "ChartView.theme");
52 compare(chartView.title, "", "ChartView.title");
48 compare(chartView.title, "", "ChartView.title");
53 compare(chartView.title, "", "ChartView.title");
49 compare(chartView.title, "", "ChartView.title");
54 verify(chartView.titleColor != undefined, "ChartView.titleColor");
50 verify(chartView.titleColor != undefined, "ChartView.titleColor");
55 compare(chartView.titleFont.bold, false, "ChartView.titleFont.bold");
51 compare(chartView.titleFont.bold, false, "ChartView.titleFont.bold");
56 // Legend
52 // Legend
57 compare(chartView.legend.visible, true, "ChartView.legend.visible");
53 compare(chartView.legend.visible, true, "ChartView.legend.visible");
58 compare(chartView.legend.alignment, Qt.AlignTop, "ChartView.legend.alignment");
54 compare(chartView.legend.alignment, Qt.AlignTop, "ChartView.legend.alignment");
59 compare(chartView.legend.backgroundVisible, false, "ChartView.legend.backgroundVisible");
55 compare(chartView.legend.backgroundVisible, false, "ChartView.legend.backgroundVisible");
60 verify(chartView.legend.borderColor != undefined, "ChartView.legend.borderColor");
56 verify(chartView.legend.borderColor != undefined, "ChartView.legend.borderColor");
61 verify(chartView.legend.color != undefined, "ChartView.legend.color");
57 verify(chartView.legend.color != undefined, "ChartView.legend.color");
62 // Legend font
58 // Legend font
63 compare(chartView.legend.font.bold, false, "ChartView.legend.font.bold");
59 compare(chartView.legend.font.bold, false, "ChartView.legend.font.bold");
64 compare(chartView.legend.font.capitalization, Font.MixedCase, "ChartView.legend.font.capitalization");
60 compare(chartView.legend.font.capitalization, Font.MixedCase, "ChartView.legend.font.capitalization");
65 verify(chartView.legend.font.family != "", "ChartView.legend.font.family");
61 verify(chartView.legend.font.family != "", "ChartView.legend.font.family");
66 compare(chartView.legend.font.italic, false, "ChartView.legend.font.italic");
62 compare(chartView.legend.font.italic, false, "ChartView.legend.font.italic");
67 compare(chartView.legend.font.letterSpacing, 0.0, "ChartView.legend.font.letterSpacing");
63 compare(chartView.legend.font.letterSpacing, 0.0, "ChartView.legend.font.letterSpacing");
68 verify(chartView.legend.font.pixelSize > 0
64 verify(chartView.legend.font.pixelSize > 0
69 && chartView.legend.font.pixelSize < 50, "ChartView.legend.font.pixelSize");
65 && chartView.legend.font.pixelSize < 50, "ChartView.legend.font.pixelSize");
70 verify(chartView.legend.font.pointSize > 0
66 verify(chartView.legend.font.pointSize > 0
71 && chartView.legend.font.pointSize < 50, "ChartView.legend.font.pointSize");
67 && chartView.legend.font.pointSize < 50, "ChartView.legend.font.pointSize");
72 compare(chartView.legend.font.strikeout, false, "ChartView.legend.font.strikeout");
68 compare(chartView.legend.font.strikeout, false, "ChartView.legend.font.strikeout");
73 compare(chartView.legend.font.underline, false, "ChartView.legend.font.underline");
69 compare(chartView.legend.font.underline, false, "ChartView.legend.font.underline");
74 compare(chartView.legend.font.weight, Font.Normal, "ChartView.legend.font.weight");
70 compare(chartView.legend.font.weight, Font.Normal, "ChartView.legend.font.weight");
75 compare(chartView.legend.font.wordSpacing, 0.0, "ChartView.legend.font.wordSpacing");
71 compare(chartView.legend.font.wordSpacing, 0.0, "ChartView.legend.font.wordSpacing");
76 compare(chartView.axes.length, 0, "ChartView.axes.length");
77 }
72 }
78 }
73 }
79
74
80 ChartView {
75 ChartView {
81 id: chartView
76 id: chartView
82 anchors.fill: parent
77 anchors.fill: parent
83 }
78 }
84 }
79 }
@@ -1,79 +1,79
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2013 Digia Plc
3 ** Copyright (C) 2013 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Enterprise Charts Add-on.
7 ** This file is part of the Qt Enterprise Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise License Agreement provided with the
11 ** accordance with the Qt Enterprise License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 import QtQuick 1.0
21 import QtQuick 2.0
22 import QtQuickTest 1.0
22 import QtTest 1.0
23 import QtCommercial.Chart 1.1
23 import QtCommercial.Chart 1.1
24
24
25 Rectangle {
25 Rectangle {
26 width: 400
26 width: 400
27 height: 300
27 height: 300
28
28
29 TestCase {
29 TestCase {
30 id: tc1
30 id: tc1
31 name: "tst_qml-qtquicktest ChartView Properties 1.1"
31 name: "tst_qml-qtquicktest ChartView Properties 1.1"
32 when: windowShown
32 when: windowShown
33
33
34 function test_chartViewProperties() {
34 function test_chartViewProperties() {
35 compare(chartView.animationOptions, ChartView.NoAnimation, "ChartView.animationOptions");
35 compare(chartView.animationOptions, ChartView.NoAnimation, "ChartView.animationOptions");
36 verify(chartView.backgroundColor != undefined);
36 verify(chartView.backgroundColor != undefined);
37 verify(chartView.bottomMargin > 0, "ChartView.bottomMargin");
37 verify(chartView.bottomMargin > 0, "ChartView.bottomMargin");
38 verify(chartView.topMargin > 0, "ChartView.topMargin");
38 verify(chartView.topMargin > 0, "ChartView.topMargin");
39 verify(chartView.leftMargin > 0, "ChartView.leftMargin");
39 verify(chartView.leftMargin > 0, "ChartView.leftMargin");
40 verify(chartView.rightMargin > 0, "ChartView.rightMargin");
40 verify(chartView.rightMargin > 0, "ChartView.rightMargin");
41 compare(chartView.count, 0, "ChartView.count");
41 compare(chartView.count, 0, "ChartView.count");
42 compare(chartView.dropShadowEnabled, false, "ChartView.dropShadowEnabled");
42 compare(chartView.dropShadowEnabled, false, "ChartView.dropShadowEnabled");
43 verify(chartView.plotArea.height > 0, "ChartView.plotArea.height");
43 verify(chartView.plotArea.height > 0, "ChartView.plotArea.height");
44 verify(chartView.plotArea.width > 0, "ChartView.plotArea.width");
44 verify(chartView.plotArea.width > 0, "ChartView.plotArea.width");
45 verify(chartView.plotArea.x > 0, "ChartView.plotArea.x");
45 verify(chartView.plotArea.x > 0, "ChartView.plotArea.x");
46 verify(chartView.plotArea.y > 0, "ChartView.plotArea.y");
46 verify(chartView.plotArea.y > 0, "ChartView.plotArea.y");
47 compare(chartView.theme, ChartView.ChartThemeLight, "ChartView.theme");
47 compare(chartView.theme, ChartView.ChartThemeLight, "ChartView.theme");
48 compare(chartView.title, "", "ChartView.title");
48 compare(chartView.title, "", "ChartView.title");
49 compare(chartView.title, "", "ChartView.title");
49 compare(chartView.title, "", "ChartView.title");
50 verify(chartView.titleColor != undefined, "ChartView.titleColor");
50 verify(chartView.titleColor != undefined, "ChartView.titleColor");
51 compare(chartView.titleFont.bold, false, "ChartView.titleFont.bold");
51 compare(chartView.titleFont.bold, false, "ChartView.titleFont.bold");
52 // Legend
52 // Legend
53 compare(chartView.legend.visible, true, "ChartView.legend.visible");
53 compare(chartView.legend.visible, true, "ChartView.legend.visible");
54 compare(chartView.legend.alignment, Qt.AlignTop, "ChartView.legend.alignment");
54 compare(chartView.legend.alignment, Qt.AlignTop, "ChartView.legend.alignment");
55 compare(chartView.legend.backgroundVisible, false, "ChartView.legend.backgroundVisible");
55 compare(chartView.legend.backgroundVisible, false, "ChartView.legend.backgroundVisible");
56 verify(chartView.legend.borderColor != undefined, "ChartView.legend.borderColor");
56 verify(chartView.legend.borderColor != undefined, "ChartView.legend.borderColor");
57 verify(chartView.legend.color != undefined, "ChartView.legend.color");
57 verify(chartView.legend.color != undefined, "ChartView.legend.color");
58 // Legend font
58 // Legend font
59 compare(chartView.legend.font.bold, false, "ChartView.legend.font.bold");
59 compare(chartView.legend.font.bold, false, "ChartView.legend.font.bold");
60 compare(chartView.legend.font.capitalization, Font.MixedCase, "ChartView.legend.font.capitalization");
60 compare(chartView.legend.font.capitalization, Font.MixedCase, "ChartView.legend.font.capitalization");
61 verify(chartView.legend.font.family != "", "ChartView.legend.font.family");
61 verify(chartView.legend.font.family != "", "ChartView.legend.font.family");
62 compare(chartView.legend.font.italic, false, "ChartView.legend.font.italic");
62 compare(chartView.legend.font.italic, false, "ChartView.legend.font.italic");
63 compare(chartView.legend.font.letterSpacing, 0.0, "ChartView.legend.font.letterSpacing");
63 compare(chartView.legend.font.letterSpacing, 0.0, "ChartView.legend.font.letterSpacing");
64 verify(chartView.legend.font.pixelSize > 0
64 verify(chartView.legend.font.pixelSize > 0
65 && chartView.legend.font.pixelSize < 50, "ChartView.legend.font.pixelSize");
65 && chartView.legend.font.pixelSize < 50, "ChartView.legend.font.pixelSize");
66 verify(chartView.legend.font.pointSize > 0
66 verify(chartView.legend.font.pointSize > 0
67 && chartView.legend.font.pointSize < 50, "ChartView.legend.font.pointSize");
67 && chartView.legend.font.pointSize < 50, "ChartView.legend.font.pointSize");
68 compare(chartView.legend.font.strikeout, false, "ChartView.legend.font.strikeout");
68 compare(chartView.legend.font.strikeout, false, "ChartView.legend.font.strikeout");
69 compare(chartView.legend.font.underline, false, "ChartView.legend.font.underline");
69 compare(chartView.legend.font.underline, false, "ChartView.legend.font.underline");
70 compare(chartView.legend.font.weight, Font.Normal, "ChartView.legend.font.weight");
70 compare(chartView.legend.font.weight, Font.Normal, "ChartView.legend.font.weight");
71 compare(chartView.legend.font.wordSpacing, 0.0, "ChartView.legend.font.wordSpacing");
71 compare(chartView.legend.font.wordSpacing, 0.0, "ChartView.legend.font.wordSpacing");
72 }
72 }
73 }
73 }
74
74
75 ChartView {
75 ChartView {
76 id: chartView
76 id: chartView
77 anchors.fill: parent
77 anchors.fill: parent
78 }
78 }
79 }
79 }
@@ -1,160 +1,160
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2013 Digia Plc
3 ** Copyright (C) 2013 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Enterprise Charts Add-on.
7 ** This file is part of the Qt Enterprise Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise License Agreement provided with the
11 ** accordance with the Qt Enterprise License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 import QtQuick 1.0
21 import QtQuick 2.0
22 import QtQuickTest 1.0
22 import QtTest 1.0
23 import QtCommercial.Chart 1.2
23 import QtCommercial.Chart 1.3
24
24
25 Rectangle {
25 Rectangle {
26 width: 400
26 width: 400
27 height: 300
27 height: 300
28
28
29 TestCase {
29 TestCase {
30 id: tc1
30 id: tc1
31 name: "tst_qml-qtquicktest ChartView Functions"
31 name: "tst_qml-qtquicktest ChartView Functions"
32 when: windowShown
32 when: windowShown
33
33
34 function test_chartViewSeriesAndAxes() {
34 function test_chartViewSeriesAndAxes() {
35 // Create XY series
35 // Create XY series
36 var line = chartView.createSeries(ChartView.SeriesTypeLine, "line");
36 var line = chartView.createSeries(ChartView.SeriesTypeLine, "line");
37 verify(line != null && line != undefined);
37 verify(line != null && line != undefined);
38 var spline = chartView.createSeries(ChartView.SeriesTypeSpline, "spline");
38 var spline = chartView.createSeries(ChartView.SeriesTypeSpline, "spline");
39 verify(spline != null && spline != undefined);
39 verify(spline != null && spline != undefined);
40 var scatter = chartView.createSeries(ChartView.SeriesTypeScatter, "scatter");
40 var scatter = chartView.createSeries(ChartView.SeriesTypeScatter, "scatter");
41 verify(scatter != null && scatter != undefined);
41 verify(scatter != null && scatter != undefined);
42
42
43 // Create a series with specific axes
43 // Create a series with specific axes
44 var line2 = chartView.createSeries(ChartView.SeriesTypeLine, "line2", chartView.axisX(line), chartView.axisY(line));
44 var line2 = chartView.createSeries(ChartView.SeriesTypeLine, "line2", chartView.axisX(line), chartView.axisY(line));
45
45
46 // Check that all the XY series use the same axes
46 // Check that all the XY series use the same axes
47 verify(chartView.axisX(line) != null);
47 verify(chartView.axisX(line) != null);
48 verify(chartView.axisY(line) != null);
48 verify(chartView.axisY(line) != null);
49 compare(chartView.axisX(line), chartView.axisX(line2));
49 compare(chartView.axisX(line), chartView.axisX(line2));
50 compare(chartView.axisY(line), chartView.axisY(line2));
50 compare(chartView.axisY(line), chartView.axisY(line2));
51 compare(chartView.axisX(line), chartView.axisX(spline));
51 compare(chartView.axisX(line), chartView.axisX(spline));
52 compare(chartView.axisY(line), chartView.axisY(spline));
52 compare(chartView.axisY(line), chartView.axisY(spline));
53 compare(chartView.axisX(line), chartView.axisX(scatter));
53 compare(chartView.axisX(line), chartView.axisX(scatter));
54 compare(chartView.axisY(line), chartView.axisY(scatter));
54 compare(chartView.axisY(line), chartView.axisY(scatter));
55
55
56 var bar = chartView.createSeries(ChartView.SeriesTypeBar, "bar");
56 var bar = chartView.createSeries(ChartView.SeriesTypeBar, "bar");
57 verify(bar != null && bar != undefined);
57 verify(bar != null && bar != undefined);
58 var stackedbar = chartView.createSeries(ChartView.SeriesTypeStackedBar, "stackedbar");
58 var stackedbar = chartView.createSeries(ChartView.SeriesTypeStackedBar, "stackedbar");
59 verify(stackedbar != null && stackedbar != undefined);
59 verify(stackedbar != null && stackedbar != undefined);
60 var percentbar = chartView.createSeries(ChartView.SeriesTypePercentBar, "percentbar");
60 var percentbar = chartView.createSeries(ChartView.SeriesTypePercentBar, "percentbar");
61 verify(percentbar != null && percentbar != undefined);
61 verify(percentbar != null && percentbar != undefined);
62 var horizontalbar = chartView.createSeries(ChartView.SeriesTypeHorizontalBar, "horizontalbar");
62 var horizontalbar = chartView.createSeries(ChartView.SeriesTypeHorizontalBar, "horizontalbar");
63 verify(horizontalbar != null && horizontalbar != undefined);
63 verify(horizontalbar != null && horizontalbar != undefined);
64 var horizontalstackedbar = chartView.createSeries(ChartView.SeriesTypeHorizontalStackedBar, "horizontalstackedbar");
64 var horizontalstackedbar = chartView.createSeries(ChartView.SeriesTypeHorizontalStackedBar, "horizontalstackedbar");
65 verify(horizontalstackedbar != null && horizontalstackedbar != undefined);
65 verify(horizontalstackedbar != null && horizontalstackedbar != undefined);
66 var horizontalpercentbar = chartView.createSeries(ChartView.SeriesTypeHorizontalPercentBar, "horizontalpercentbar");
66 var horizontalpercentbar = chartView.createSeries(ChartView.SeriesTypeHorizontalPercentBar, "horizontalpercentbar");
67 verify(horizontalpercentbar != null && horizontalpercentbar != undefined);
67 verify(horizontalpercentbar != null && horizontalpercentbar != undefined);
68 var area = chartView.createSeries(ChartView.SeriesTypeArea, "area");
68 var area = chartView.createSeries(ChartView.SeriesTypeArea, "area");
69 verify(area != null && area != undefined);
69 verify(area != null && area != undefined);
70
70
71 // Remove all series
71 // Remove all series
72 chartView.removeAllSeries();
72 chartView.removeAllSeries();
73 compare(chartView.count, 0);
73 compare(chartView.count, 0);
74 }
74 }
75
75
76 function test_chartViewRange() {
76 function test_chartViewRange() {
77 // Set initial values
77 // Set initial values
78 chartView.createSeries(ChartView.SeriesTypeLine, "line");
78 chartView.createSeries(ChartView.SeriesTypeLine, "line");
79 verify(chartView.axisX() != null);
79 verify(chartView.axisX() != null);
80 verify(chartView.axisY() != null);
80 verify(chartView.axisY() != null);
81 chartView.axisX().min = 1.0;
81 chartView.axisX().min = 1.0;
82 chartView.axisX().max = 2.0;
82 chartView.axisX().max = 2.0;
83 chartView.axisY().min = 1.0;
83 chartView.axisY().min = 1.0;
84 chartView.axisY().max = 2.0;
84 chartView.axisY().max = 2.0;
85
85
86 var xMax = chartView.axisX().max;
86 var xMax = chartView.axisX().max;
87 var xMin = chartView.axisX().min;
87 var xMin = chartView.axisX().min;
88 var yMax = chartView.axisY().max;
88 var yMax = chartView.axisY().max;
89 var yMin = chartView.axisY().min;
89 var yMin = chartView.axisY().min;
90
90
91 // zoom x 2.5
91 // zoom x 2.5
92 chartView.zoom(1.5);
92 chartView.zoom(1.5);
93 verify(chartView.axisX().max < xMax);
93 verify(chartView.axisX().max < xMax);
94 verify(chartView.axisX().min > xMin);
94 verify(chartView.axisX().min > xMin);
95 verify(chartView.axisY().max < yMax);
95 verify(chartView.axisY().max < yMax);
96 verify(chartView.axisY().min > yMin);
96 verify(chartView.axisY().min > yMin);
97 xMax = chartView.axisX().max;
97 xMax = chartView.axisX().max;
98 xMin = chartView.axisX().min;
98 xMin = chartView.axisX().min;
99 yMax = chartView.axisY().max;
99 yMax = chartView.axisY().max;
100 yMin = chartView.axisY().min;
100 yMin = chartView.axisY().min;
101
101
102 // zoom x 0.5
102 // zoom x 0.5
103 chartView.zoom(0.5);
103 chartView.zoom(0.5);
104 verify(chartView.axisX().max > xMax);
104 verify(chartView.axisX().max > xMax);
105 verify(chartView.axisX().min < xMin);
105 verify(chartView.axisX().min < xMin);
106 verify(chartView.axisY().max > yMax);
106 verify(chartView.axisY().max > yMax);
107 verify(chartView.axisY().min < yMin);
107 verify(chartView.axisY().min < yMin);
108 xMax = chartView.axisX().max;
108 xMax = chartView.axisX().max;
109 xMin = chartView.axisX().min;
109 xMin = chartView.axisX().min;
110 yMax = chartView.axisY().max;
110 yMax = chartView.axisY().max;
111 yMin = chartView.axisY().min;
111 yMin = chartView.axisY().min;
112
112
113 // Scroll up
113 // Scroll up
114 chartView.scrollUp(10);
114 chartView.scrollUp(10);
115 compare(chartView.axisX().max, xMax);
115 compare(chartView.axisX().max, xMax);
116 compare(chartView.axisX().min, xMin);
116 compare(chartView.axisX().min, xMin);
117 verify(chartView.axisY().max > yMax);
117 verify(chartView.axisY().max > yMax);
118 verify(chartView.axisY().min > yMin);
118 verify(chartView.axisY().min > yMin);
119 xMax = chartView.axisX().max;
119 xMax = chartView.axisX().max;
120 xMin = chartView.axisX().min;
120 xMin = chartView.axisX().min;
121 yMax = chartView.axisY().max;
121 yMax = chartView.axisY().max;
122 yMin = chartView.axisY().min;
122 yMin = chartView.axisY().min;
123
123
124 // Scroll down
124 // Scroll down
125 chartView.scrollDown(10);
125 chartView.scrollDown(10);
126 compare(chartView.axisX().max, xMax);
126 compare(chartView.axisX().max, xMax);
127 compare(chartView.axisX().min, xMin);
127 compare(chartView.axisX().min, xMin);
128 verify(chartView.axisY().max < yMax);
128 verify(chartView.axisY().max < yMax);
129 verify(chartView.axisY().min < yMin);
129 verify(chartView.axisY().min < yMin);
130 xMax = chartView.axisX().max;
130 xMax = chartView.axisX().max;
131 xMin = chartView.axisX().min;
131 xMin = chartView.axisX().min;
132 yMax = chartView.axisY().max;
132 yMax = chartView.axisY().max;
133 yMin = chartView.axisY().min;
133 yMin = chartView.axisY().min;
134
134
135 // Scroll left
135 // Scroll left
136 chartView.scrollLeft(10);
136 chartView.scrollLeft(10);
137 verify(chartView.axisX().max < xMax);
137 verify(chartView.axisX().max < xMax);
138 verify(chartView.axisX().min < xMin);
138 verify(chartView.axisX().min < xMin);
139 compare(chartView.axisY().max, yMax);
139 compare(chartView.axisY().max, yMax);
140 compare(chartView.axisY().min, yMin);
140 compare(chartView.axisY().min, yMin);
141 xMax = chartView.axisX().max;
141 xMax = chartView.axisX().max;
142 xMin = chartView.axisX().min;
142 xMin = chartView.axisX().min;
143 yMax = chartView.axisY().max;
143 yMax = chartView.axisY().max;
144 yMin = chartView.axisY().min;
144 yMin = chartView.axisY().min;
145
145
146 // Scroll right
146 // Scroll right
147 chartView.scrollRight(10);
147 chartView.scrollRight(10);
148 verify(chartView.axisX().max > xMax);
148 verify(chartView.axisX().max > xMax);
149 verify(chartView.axisX().min > xMin);
149 verify(chartView.axisX().min > xMin);
150 compare(chartView.axisY().max, yMax);
150 compare(chartView.axisY().max, yMax);
151 compare(chartView.axisY().min, yMin);
151 compare(chartView.axisY().min, yMin);
152 }
152 }
153 }
153 }
154
154
155 ChartView {
155 ChartView {
156 id: chartView
156 id: chartView
157 anchors.fill: parent
157 anchors.fill: parent
158 title: "Chart"
158 title: "Chart"
159 }
159 }
160 }
160 }
@@ -1,158 +1,160
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2013 Digia Plc
3 ** Copyright (C) 2013 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Enterprise Charts Add-on.
7 ** This file is part of the Qt Enterprise Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise License Agreement provided with the
11 ** accordance with the Qt Enterprise License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 import QtQuick 1.0
21 import QtQuick 2.0
22 import QtQuickTest 1.0
22 import QtTest 1.0
23 import QtCommercial.Chart 1.1
23 import QtCommercial.Chart 1.1
24
24
25 Rectangle {
25 Rectangle {
26 width: 400
26 width: 400
27 height: 300
27 height: 300
28
28
29 TestCase {
29 TestCase {
30 id: tc1
30 id: tc1
31 name: "tst_qml-qtquicktest ChartView Functions 1.1"
31 name: "tst_qml-qtquicktest ChartView Functions 1.1"
32 when: windowShown
32 when: windowShown
33
33
34 function test_chartViewSeriesAndAxes() {
34 function test_chartViewSeriesAndAxes() {
35 // Create XY series
35 // Create XY series
36 var line = chartView.createSeries(ChartView.SeriesTypeLine, "line");
36 var line = chartView.createSeries(ChartView.SeriesTypeLine, "line");
37 verify(line != null && line != undefined);
37 verify(line != null && line != undefined);
38 var spline = chartView.createSeries(ChartView.SeriesTypeSpline, "spline");
38 var spline = chartView.createSeries(ChartView.SeriesTypeSpline, "spline");
39 verify(spline != null && spline != undefined);
39 verify(spline != null && spline != undefined);
40 var scatter = chartView.createSeries(ChartView.SeriesTypeScatter, "scatter");
40 var scatter = chartView.createSeries(ChartView.SeriesTypeScatter, "scatter");
41 verify(scatter != null && scatter != undefined);
41 verify(scatter != null && scatter != undefined);
42
42
43 // Create a series with specific axes
43 // Create a series with specific axes
44 var line2 = chartView.createSeries(ChartView.SeriesTypeLine, "line2", chartView.axisX(line), chartView.axisY(line));
44 var line2 = chartView.createSeries(ChartView.SeriesTypeLine, "line2", chartView.axisX(line), chartView.axisY(line));
45
45
46 // Check that all the XY series use the same axes
46 // Check that all the XY series use the same axes
47 verify(chartView.axisX(line) != null);
47 verify(chartView.axisX(line) != null);
48 verify(chartView.axisY(line) != null);
48 verify(chartView.axisY(line) != null);
49 compare(chartView.axisX(line), chartView.axisX(line2));
49 compare(chartView.axisX(line), chartView.axisX(line2));
50 compare(chartView.axisY(line), chartView.axisY(line2));
50 compare(chartView.axisY(line), chartView.axisY(line2));
51 compare(chartView.axisX(line), chartView.axisX(spline));
51 compare(chartView.axisX(line), chartView.axisX(spline));
52 compare(chartView.axisY(line), chartView.axisY(spline));
52 compare(chartView.axisY(line), chartView.axisY(spline));
53 compare(chartView.axisX(line), chartView.axisX(scatter));
53 compare(chartView.axisX(line), chartView.axisX(scatter));
54 compare(chartView.axisY(line), chartView.axisY(scatter));
54 compare(chartView.axisY(line), chartView.axisY(scatter));
55
55
56 var bar = chartView.createSeries(ChartView.SeriesTypeBar, "bar");
56 var bar = chartView.createSeries(ChartView.SeriesTypeBar, "bar");
57 verify(bar != null && bar != undefined);
57 verify(bar != null && bar != undefined);
58 var stackedbar = chartView.createSeries(ChartView.SeriesTypeStackedBar, "stackedbar");
58 var stackedbar = chartView.createSeries(ChartView.SeriesTypeStackedBar, "stackedbar");
59 verify(stackedbar != null && stackedbar != undefined);
59 verify(stackedbar != null && stackedbar != undefined);
60 var percentbar = chartView.createSeries(ChartView.SeriesTypePercentBar, "percentbar");
60 var percentbar = chartView.createSeries(ChartView.SeriesTypePercentBar, "percentbar");
61 verify(percentbar != null && percentbar != undefined);
61 verify(percentbar != null && percentbar != undefined);
62 var horizontalbar = chartView.createSeries(ChartView.SeriesTypeHorizontalBar, "horizontalbar");
62 var horizontalbar = chartView.createSeries(ChartView.SeriesTypeHorizontalBar, "horizontalbar");
63 verify(horizontalbar != null && horizontalbar != undefined);
63 verify(horizontalbar != null && horizontalbar != undefined);
64 var horizontalstackedbar = chartView.createSeries(ChartView.SeriesTypeHorizontalStackedBar, "horizontalstackedbar");
64 var horizontalstackedbar = chartView.createSeries(ChartView.SeriesTypeHorizontalStackedBar, "horizontalstackedbar");
65 verify(horizontalstackedbar != null && horizontalstackedbar != undefined);
65 verify(horizontalstackedbar != null && horizontalstackedbar != undefined);
66 var horizontalpercentbar = chartView.createSeries(ChartView.SeriesTypeHorizontalPercentBar, "horizontalpercentbar");
66 var horizontalpercentbar = chartView.createSeries(ChartView.SeriesTypeHorizontalPercentBar, "horizontalpercentbar");
67 verify(horizontalpercentbar != null && horizontalpercentbar != undefined);
67 verify(horizontalpercentbar != null && horizontalpercentbar != undefined);
68 var area = chartView.createSeries(ChartView.SeriesTypeArea, "area");
68 var area = chartView.createSeries(ChartView.SeriesTypeArea, "area");
69 verify(area != null && area != undefined);
69 verify(area != null && area != undefined);
70
70
71 // Remove all series
71 // Remove all series
72 chartView.removeAllSeries();
72 chartView.removeAllSeries();
73 compare(chartView.count, 0);
73 compare(chartView.count, 0);
74 }
74 }
75
75
76 function test_chartViewRange() {
76 function test_chartViewRange() {
77 // Set initial values
77 // Set initial values
78 chartView.createSeries(ChartView.SeriesTypeLine, "line");
78 chartView.createSeries(ChartView.SeriesTypeLine, "line");
79 verify(chartView.axisX() != null);
79 verify(chartView.axisX() != null);
80 verify(chartView.axisY() != null);
80 verify(chartView.axisY() != null);
81 chartView.axisX().min = 1.0;
81 chartView.axisX().min = 1.0;
82 chartView.axisX().max = 2.0;
82 chartView.axisX().max = 2.0;
83 chartView.axisY().min = 1.0;
83 chartView.axisY().min = 1.0;
84 chartView.axisY().max = 2.0;
84 chartView.axisY().max = 2.0;
85
85
86 var xMax = chartView.axisX().max;
86 var xMax = chartView.axisX().max;
87 var xMin = chartView.axisX().min;
87 var xMin = chartView.axisX().min;
88 var yMax = chartView.axisY().max;
88 var yMax = chartView.axisY().max;
89 var yMin = chartView.axisY().min;
89 var yMin = chartView.axisY().min;
90
90
91 // zoom x 2.5
91 // zoom x 2.5
92 chartView.zoom(1.5);
92 chartView.zoom(1.5);
93 verify(chartView.axisX().max < xMax);
93 verify(chartView.axisX().max < xMax);
94 verify(chartView.axisX().min > xMin);
94 verify(chartView.axisX().min > xMin);
95 verify(chartView.axisY().max < yMax);
95 verify(chartView.axisY().max < yMax);
96 verify(chartView.axisY().min > yMin);
96 verify(chartView.axisY().min > yMin);
97 xMax = chartView.axisX().max;
97 xMax = chartView.axisX().max;
98 xMin = chartView.axisX().min;
98 xMin = chartView.axisX().min;
99 yMax = chartView.axisY().max;
99 yMax = chartView.axisY().max;
100 yMin = chartView.axisY().min;
100 yMin = chartView.axisY().min;
101
101
102 // zoom x 0.5
102 // zoom x 0.5
103 chartView.zoom(0.5);
103 chartView.zoom(0.5);
104 verify(chartView.axisX().max > xMax);
104 verify(chartView.axisX().max > xMax);
105 verify(chartView.axisX().min < xMin);
105 verify(chartView.axisX().min < xMin);
106 verify(chartView.axisY().max > yMax);
106 verify(chartView.axisY().max > yMax);
107 verify(chartView.axisY().min < yMin);
107 verify(chartView.axisY().min < yMin);
108 xMax = chartView.axisX().max;
108 xMax = chartView.axisX().max;
109 xMin = chartView.axisX().min;
109 xMin = chartView.axisX().min;
110 yMax = chartView.axisY().max;
110 yMax = chartView.axisY().max;
111 yMin = chartView.axisY().min;
111 yMin = chartView.axisY().min;
112
112
113 // Scroll up
113 // Scroll up
114 chartView.scrollUp(10);
114 chartView.scrollUp(10);
115 compare(chartView.axisX().max, xMax);
115 compare(chartView.axisX().max, xMax);
116 compare(chartView.axisX().min, xMin);
116 compare(chartView.axisX().min, xMin);
117 verify(chartView.axisY().max > yMax);
117 verify(chartView.axisY().max > yMax);
118 verify(chartView.axisY().min > yMin);
118 verify(chartView.axisY().min > yMin);
119 xMax = chartView.axisX().max;
119 xMax = chartView.axisX().max;
120 xMin = chartView.axisX().min;
120 xMin = chartView.axisX().min;
121 yMax = chartView.axisY().max;
121 yMax = chartView.axisY().max;
122 yMin = chartView.axisY().min;
122 yMin = chartView.axisY().min;
123
123
124 // Scroll down
124 // Scroll down
125 chartView.scrollDown(10);
125 chartView.scrollDown(10);
126 compare(chartView.axisX().max, xMax);
126 compare(chartView.axisX().max, xMax);
127 compare(chartView.axisX().min, xMin);
127 compare(chartView.axisX().min, xMin);
128 verify(chartView.axisY().max < yMax);
128 verify(chartView.axisY().max < yMax);
129 verify(chartView.axisY().min < yMin);
129 verify(chartView.axisY().min < yMin);
130 xMax = chartView.axisX().max;
130 xMax = chartView.axisX().max;
131 xMin = chartView.axisX().min;
131 xMin = chartView.axisX().min;
132 yMax = chartView.axisY().max;
132 yMax = chartView.axisY().max;
133 yMin = chartView.axisY().min;
133 yMin = chartView.axisY().min;
134
134
135 // Scroll left
135 chartView.scrollLeft(10);
136 chartView.scrollLeft(10);
136 verify(chartView.axisX().max < xMax);
137 verify(chartView.axisX().max < xMax);
137 verify(chartView.axisX().min < xMin);
138 verify(chartView.axisX().min < xMin);
138 compare(chartView.axisY().max, yMax);
139 compare(chartView.axisY().max, yMax);
139 compare(chartView.axisY().min, yMin);
140 compare(chartView.axisY().min, yMin);
140 xMax = chartView.axisX().max;
141 xMax = chartView.axisX().max;
141 xMin = chartView.axisX().min;
142 xMin = chartView.axisX().min;
142 yMax = chartView.axisY().max;
143 yMax = chartView.axisY().max;
143 yMin = chartView.axisY().min;
144 yMin = chartView.axisY().min;
144
145
146 // Scroll right
145 chartView.scrollRight(10);
147 chartView.scrollRight(10);
146 verify(chartView.axisX().max > xMax);
148 verify(chartView.axisX().max > xMax);
147 verify(chartView.axisX().min > xMin);
149 verify(chartView.axisX().min > xMin);
148 compare(chartView.axisY().max, yMax);
150 compare(chartView.axisY().max, yMax);
149 compare(chartView.axisY().min, yMin);
151 compare(chartView.axisY().min, yMin);
150 }
152 }
151 }
153 }
152
154
153 ChartView {
155 ChartView {
154 id: chartView
156 id: chartView
155 anchors.fill: parent
157 anchors.fill: parent
156 title: "Chart"
158 title: "Chart"
157 }
159 }
158 }
160 }
@@ -1,73 +1,73
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2013 Digia Plc
3 ** Copyright (C) 2013 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Enterprise Charts Add-on.
7 ** This file is part of the Qt Enterprise Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise License Agreement provided with the
11 ** accordance with the Qt Enterprise License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 import QtQuick 1.0
21 import QtQuick 2.0
22 import QtQuickTest 1.0
22 import QtTest 1.0
23 import QtCommercial.Chart 1.2
23 import QtCommercial.Chart 1.3
24
24
25 Rectangle {
25 Rectangle {
26 width: 400
26 width: 400
27 height: 300
27 height: 300
28
28
29 TestCase {
29 TestCase {
30 id: tc1
30 id: tc1
31 name: "tst_qml-qtquicktest ChartView Signals"
31 name: "tst_qml-qtquicktest ChartView Signals"
32 when: windowShown
32 when: windowShown
33
33
34 // Verify onSeriesAdded and onSeriesRemoved signals
34 // Verify onSeriesAdded and onSeriesRemoved signals
35 function test_chartView() {
35 function test_chartView() {
36 var series = chartView.createSeries(ChartView.SeriesTypeLine, "line");
36 var series = chartView.createSeries(ChartView.SeriesTypeLine, "line");
37 seriesAddedSpy.wait();
37 seriesAddedSpy.wait();
38 compare(seriesAddedSpy.count, 1, "ChartView.onSeriesAdded");
38 compare(seriesAddedSpy.count, 1, "ChartView.onSeriesAdded");
39
39
40 // Modifying layout triggers more than one plotAreaChanged signal
40 // Modifying layout triggers more than one plotAreaChanged signal
41 chartView.titleFont.pixelSize = 50;
41 chartView.titleFont.pixelSize = 50;
42 verify(plotAreaChangedSpy.count > 0, "ChartView.onPlotAreaChanged");
42 verify(plotAreaChangedSpy.count > 0, "ChartView.onPlotAreaChanged");
43
43
44 chartView.removeSeries(series);
44 chartView.removeSeries(series);
45 seriesRemovedSpy.wait();
45 seriesRemovedSpy.wait();
46 compare(seriesRemovedSpy.count, 1, "ChartView.onSeriesAdded");
46 compare(seriesRemovedSpy.count, 1, "ChartView.onSeriesAdded");
47 }
47 }
48 }
48 }
49
49
50 ChartView {
50 ChartView {
51 id: chartView
51 id: chartView
52 anchors.fill: parent
52 anchors.fill: parent
53 title: "Chart"
53 title: "Chart"
54
54
55 SignalSpy {
55 SignalSpy {
56 id: plotAreaChangedSpy
56 id: plotAreaChangedSpy
57 target: chartView
57 target: chartView
58 signalName: "plotAreaChanged"
58 signalName: "plotAreaChanged"
59 }
59 }
60
60
61 SignalSpy {
61 SignalSpy {
62 id: seriesAddedSpy
62 id: seriesAddedSpy
63 target: chartView
63 target: chartView
64 signalName: "seriesAdded"
64 signalName: "seriesAdded"
65 }
65 }
66
66
67 SignalSpy {
67 SignalSpy {
68 id: seriesRemovedSpy
68 id: seriesRemovedSpy
69 target: chartView
69 target: chartView
70 signalName: "seriesRemoved"
70 signalName: "seriesRemoved"
71 }
71 }
72 }
72 }
73 }
73 }
@@ -1,73 +1,73
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2013 Digia Plc
3 ** Copyright (C) 2013 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Enterprise Charts Add-on.
7 ** This file is part of the Qt Enterprise Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise License Agreement provided with the
11 ** accordance with the Qt Enterprise License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 import QtQuick 1.0
21 import QtQuick 2.0
22 import QtQuickTest 1.0
22 import QtTest 1.0
23 import QtCommercial.Chart 1.1
23 import QtCommercial.Chart 1.1
24
24
25 Rectangle {
25 Rectangle {
26 width: 400
26 width: 400
27 height: 300
27 height: 300
28
28
29 TestCase {
29 TestCase {
30 id: tc1
30 id: tc1
31 name: "tst_qml-qtquicktest ChartView Signals 1.1"
31 name: "tst_qml-qtquicktest ChartView Signals 1.1"
32 when: windowShown
32 when: windowShown
33
33
34 // Verify onSeriesAdded and onSeriesRemoved signals
34 // Verify onSeriesAdded and onSeriesRemoved signals
35 function test_chartView() {
35 function test_chartView() {
36 var series = chartView.createSeries(ChartView.SeriesTypeLine, "line");
36 var series = chartView.createSeries(ChartView.SeriesTypeLine, "line");
37 seriesAddedSpy.wait();
37 seriesAddedSpy.wait();
38 compare(seriesAddedSpy.count, 1, "ChartView.onSeriesAdded");
38 compare(seriesAddedSpy.count, 1, "ChartView.onSeriesAdded");
39
39
40 // Modifying layout triggers more than one plotAreaChanged signal
40 // Modifying layout triggers more than one plotAreaChanged signal
41 chartView.titleFont.pixelSize = 50;
41 chartView.titleFont.pixelSize = 50;
42 verify(plotAreaChangedSpy.count > 0, "ChartView.onPlotAreaChanged");
42 verify(plotAreaChangedSpy.count > 0, "ChartView.onPlotAreaChanged");
43
43
44 chartView.removeSeries(series);
44 chartView.removeSeries(series);
45 seriesRemovedSpy.wait();
45 seriesRemovedSpy.wait();
46 compare(seriesRemovedSpy.count, 1, "ChartView.onSeriesAdded");
46 compare(seriesRemovedSpy.count, 1, "ChartView.onSeriesAdded");
47 }
47 }
48 }
48 }
49
49
50 ChartView {
50 ChartView {
51 id: chartView
51 id: chartView
52 anchors.fill: parent
52 anchors.fill: parent
53 title: "Chart"
53 title: "Chart"
54
54
55 SignalSpy {
55 SignalSpy {
56 id: plotAreaChangedSpy
56 id: plotAreaChangedSpy
57 target: chartView
57 target: chartView
58 signalName: "plotAreaChanged"
58 signalName: "plotAreaChanged"
59 }
59 }
60
60
61 SignalSpy {
61 SignalSpy {
62 id: seriesAddedSpy
62 id: seriesAddedSpy
63 target: chartView
63 target: chartView
64 signalName: "seriesAdded"
64 signalName: "seriesAdded"
65 }
65 }
66
66
67 SignalSpy {
67 SignalSpy {
68 id: seriesRemovedSpy
68 id: seriesRemovedSpy
69 target: chartView
69 target: chartView
70 signalName: "seriesRemoved"
70 signalName: "seriesRemoved"
71 }
71 }
72 }
72 }
73 }
73 }
@@ -1,131 +1,131
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2013 Digia Plc
3 ** Copyright (C) 2013 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Enterprise Charts Add-on.
7 ** This file is part of the Qt Enterprise Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise License Agreement provided with the
11 ** accordance with the Qt Enterprise License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 import QtQuick 1.0
21 import QtQuick 2.0
22 import QtQuickTest 1.0
22 import QtTest 1.0
23 import QtCommercial.Chart 1.2
23 import QtCommercial.Chart 1.3
24
24
25 Rectangle {
25 Rectangle {
26 width: 400
26 width: 400
27 height: 300
27 height: 300
28
28
29 TestCase {
29 TestCase {
30 id: tc1
30 id: tc1
31 name: "tst_qml-qtquicktest PieSeries"
31 name: "tst_qml-qtquicktest PieSeries"
32 when: windowShown
32 when: windowShown
33
33
34 function test_properties() {
34 function test_properties() {
35 compare(pieSeries.endAngle, 360);
35 compare(pieSeries.endAngle, 360);
36 compare(pieSeries.holeSize, 0);
36 compare(pieSeries.holeSize, 0);
37 compare(pieSeries.horizontalPosition, 0.5);
37 compare(pieSeries.horizontalPosition, 0.5);
38 compare(pieSeries.size, 0.7);
38 compare(pieSeries.size, 0.7);
39 compare(pieSeries.startAngle, 0);
39 compare(pieSeries.startAngle, 0);
40 compare(pieSeries.sum, 0);
40 compare(pieSeries.sum, 0);
41 compare(pieSeries.verticalPosition, 0.5);
41 compare(pieSeries.verticalPosition, 0.5);
42 }
42 }
43
43
44 function test_sliceproperties() {
44 function test_sliceproperties() {
45 var slice = pieSeries.append("slice", 10);
45 var slice = pieSeries.append("slice", 10);
46 compare(slice.angleSpan, 360.0);
46 compare(slice.angleSpan, 360.0);
47 verify(slice.borderColor != undefined);
47 verify(slice.borderColor != undefined);
48 compare(slice.borderWidth, 0);
48 compare(slice.borderWidth, 1);
49 verify(slice.color != undefined);
49 verify(slice.color != undefined);
50 compare(slice.explodeDistanceFactor, 0.15);
50 compare(slice.explodeDistanceFactor, 0.15);
51 compare(slice.exploded, false);
51 compare(slice.exploded, false);
52 compare(slice.label, "slice");
52 compare(slice.label, "slice");
53 compare(slice.labelArmLengthFactor, 0.15);
53 compare(slice.labelArmLengthFactor, 0.15);
54 verify(slice.labelColor != undefined);
54 verify(slice.labelColor != undefined);
55 compare(slice.labelFont.bold, false);
55 compare(slice.labelFont.bold, false);
56 compare(slice.labelPosition, PieSlice.LabelOutside);
56 compare(slice.labelPosition, PieSlice.LabelOutside);
57 compare(slice.labelVisible, false);
57 compare(slice.labelVisible, false);
58 compare(slice.percentage, 1.0);
58 compare(slice.percentage, 1.0);
59 compare(slice.startAngle, 0.0);
59 compare(slice.startAngle, 0.0);
60 compare(slice.value, 10.0);
60 compare(slice.value, 10.0);
61 }
61 }
62
62
63 function test_append() {
63 function test_append() {
64 addedSpy.clear();
64 addedSpy.clear();
65 countChangedSpy.clear();
65 countChangedSpy.clear();
66 sumChangedSpy.clear();
66 sumChangedSpy.clear();
67 var count = 50;
67 var count = 50;
68 for (var i = 0; i < count; i++)
68 for (var i = 0; i < count; i++)
69 pieSeries.append("slice" + i, Math.random());
69 pieSeries.append("slice" + i, Math.random());
70 compare(addedSpy.count, count);
70 compare(addedSpy.count, count);
71 compare(countChangedSpy.count, count);
71 compare(countChangedSpy.count, count);
72 compare(sumChangedSpy.count, count);
72 compare(sumChangedSpy.count, count);
73 pieSeries.clear();
73 pieSeries.clear();
74 }
74 }
75
75
76 function test_remove() {
76 function test_remove() {
77 removedSpy.clear();
77 removedSpy.clear();
78 countChangedSpy.clear();
78 countChangedSpy.clear();
79 sumChangedSpy.clear();
79 sumChangedSpy.clear();
80 var count = 50;
80 var count = 50;
81 for (var i = 0; i < count; i++)
81 for (var i = 0; i < count; i++)
82 pieSeries.append("slice" + i, Math.random());
82 pieSeries.append("slice" + i, Math.random());
83 for (var j = 0; j < count; j++)
83 for (var j = 0; j < count; j++)
84 pieSeries.remove(pieSeries.at(0));
84 pieSeries.remove(pieSeries.at(0));
85 compare(removedSpy.count, count);
85 compare(removedSpy.count, count);
86 compare(countChangedSpy.count, 2 * count);
86 compare(countChangedSpy.count, 2 * count);
87 compare(sumChangedSpy.count, 2 * count);
87 compare(sumChangedSpy.count, 2 * count);
88 compare(pieSeries.count, 0);
88 compare(pieSeries.count, 0);
89 }
89 }
90
90
91 function test_find() {
91 function test_find() {
92 var count = 50;
92 var count = 50;
93 for (var i = 0; i < count; i++)
93 for (var i = 0; i < count; i++)
94 pieSeries.append("slice" + i, Math.random());
94 pieSeries.append("slice" + i, Math.random());
95 for (var j = 0; j < count; j++)
95 for (var j = 0; j < count; j++)
96 compare(pieSeries.find("slice" + j).label, "slice" + j);
96 compare(pieSeries.find("slice" + j).label, "slice" + j);
97 pieSeries.clear();
97 pieSeries.clear();
98 }
98 }
99 }
99 }
100
100
101 ChartView {
101 ChartView {
102 id: chartView
102 id: chartView
103 anchors.fill: parent
103 anchors.fill: parent
104
104
105 PieSeries {
105 PieSeries {
106 id: pieSeries
106 id: pieSeries
107 name: "pie"
107 name: "pie"
108
108
109 SignalSpy {
109 SignalSpy {
110 id: addedSpy
110 id: addedSpy
111 target: pieSeries
111 target: pieSeries
112 signalName: "added"
112 signalName: "added"
113 }
113 }
114 SignalSpy {
114 SignalSpy {
115 id: removedSpy
115 id: removedSpy
116 target: pieSeries
116 target: pieSeries
117 signalName: "removed"
117 signalName: "removed"
118 }
118 }
119 SignalSpy {
119 SignalSpy {
120 id: sumChangedSpy
120 id: sumChangedSpy
121 target: pieSeries
121 target: pieSeries
122 signalName: "sumChanged"
122 signalName: "sumChanged"
123 }
123 }
124 SignalSpy {
124 SignalSpy {
125 id: countChangedSpy
125 id: countChangedSpy
126 target: pieSeries
126 target: pieSeries
127 signalName: "countChanged"
127 signalName: "countChanged"
128 }
128 }
129 }
129 }
130 }
130 }
131 }
131 }
@@ -1,131 +1,131
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2013 Digia Plc
3 ** Copyright (C) 2013 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Enterprise Charts Add-on.
7 ** This file is part of the Qt Enterprise Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise License Agreement provided with the
11 ** accordance with the Qt Enterprise License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 import QtQuick 1.0
21 import QtQuick 2.0
22 import QtQuickTest 1.0
22 import QtTest 1.0
23 import QtCommercial.Chart 1.1
23 import QtCommercial.Chart 1.1
24
24
25 Rectangle {
25 Rectangle {
26 width: 400
26 width: 400
27 height: 300
27 height: 300
28
28
29 TestCase {
29 TestCase {
30 id: tc1
30 id: tc1
31 name: "tst_qml-qtquicktest PieSeries 1.1"
31 name: "tst_qml-qtquicktest PieSeries 1.1"
32 when: windowShown
32 when: windowShown
33
33
34 function test_properties() {
34 function test_properties() {
35 compare(pieSeries.endAngle, 360);
35 compare(pieSeries.endAngle, 360);
36 compare(pieSeries.holeSize, 0);
36 compare(pieSeries.holeSize, 0);
37 compare(pieSeries.horizontalPosition, 0.5);
37 compare(pieSeries.horizontalPosition, 0.5);
38 compare(pieSeries.size, 0.7);
38 compare(pieSeries.size, 0.7);
39 compare(pieSeries.startAngle, 0);
39 compare(pieSeries.startAngle, 0);
40 compare(pieSeries.sum, 0);
40 compare(pieSeries.sum, 0);
41 compare(pieSeries.verticalPosition, 0.5);
41 compare(pieSeries.verticalPosition, 0.5);
42 }
42 }
43
43
44 function test_sliceproperties() {
44 function test_sliceproperties() {
45 var slice = pieSeries.append("slice", 10);
45 var slice = pieSeries.append("slice", 10);
46 compare(slice.angleSpan, 360.0);
46 compare(slice.angleSpan, 360.0);
47 verify(slice.borderColor != undefined);
47 verify(slice.borderColor != undefined);
48 compare(slice.borderWidth, 0);
48 compare(slice.borderWidth, 1);
49 verify(slice.color != undefined);
49 verify(slice.color != undefined);
50 compare(slice.explodeDistanceFactor, 0.15);
50 compare(slice.explodeDistanceFactor, 0.15);
51 compare(slice.exploded, false);
51 compare(slice.exploded, false);
52 compare(slice.label, "slice");
52 compare(slice.label, "slice");
53 compare(slice.labelArmLengthFactor, 0.15);
53 compare(slice.labelArmLengthFactor, 0.15);
54 verify(slice.labelColor != undefined);
54 verify(slice.labelColor != undefined);
55 compare(slice.labelFont.bold, false);
55 compare(slice.labelFont.bold, false);
56 compare(slice.labelPosition, PieSlice.LabelOutside);
56 compare(slice.labelPosition, PieSlice.LabelOutside);
57 compare(slice.labelVisible, false);
57 compare(slice.labelVisible, false);
58 compare(slice.percentage, 1.0);
58 compare(slice.percentage, 1.0);
59 compare(slice.startAngle, 0.0);
59 compare(slice.startAngle, 0.0);
60 compare(slice.value, 10.0);
60 compare(slice.value, 10.0);
61 }
61 }
62
62
63 function test_append() {
63 function test_append() {
64 addedSpy.clear();
64 addedSpy.clear();
65 countChangedSpy.clear();
65 countChangedSpy.clear();
66 sumChangedSpy.clear();
66 sumChangedSpy.clear();
67 var count = 50;
67 var count = 50;
68 for (var i = 0; i < count; i++)
68 for (var i = 0; i < count; i++)
69 pieSeries.append("slice" + i, Math.random());
69 pieSeries.append("slice" + i, Math.random());
70 compare(addedSpy.count, count);
70 compare(addedSpy.count, count);
71 compare(countChangedSpy.count, count);
71 compare(countChangedSpy.count, count);
72 compare(sumChangedSpy.count, count);
72 compare(sumChangedSpy.count, count);
73 pieSeries.clear();
73 pieSeries.clear();
74 }
74 }
75
75
76 function test_remove() {
76 function test_remove() {
77 removedSpy.clear();
77 removedSpy.clear();
78 countChangedSpy.clear();
78 countChangedSpy.clear();
79 sumChangedSpy.clear();
79 sumChangedSpy.clear();
80 var count = 50;
80 var count = 50;
81 for (var i = 0; i < count; i++)
81 for (var i = 0; i < count; i++)
82 pieSeries.append("slice" + i, Math.random());
82 pieSeries.append("slice" + i, Math.random());
83 for (var j = 0; j < count; j++)
83 for (var j = 0; j < count; j++)
84 pieSeries.remove(pieSeries.at(0));
84 pieSeries.remove(pieSeries.at(0));
85 compare(removedSpy.count, count);
85 compare(removedSpy.count, count);
86 compare(countChangedSpy.count, 2 * count);
86 compare(countChangedSpy.count, 2 * count);
87 compare(sumChangedSpy.count, 2 * count);
87 compare(sumChangedSpy.count, 2 * count);
88 compare(pieSeries.count, 0);
88 compare(pieSeries.count, 0);
89 }
89 }
90
90
91 function test_find() {
91 function test_find() {
92 var count = 50;
92 var count = 50;
93 for (var i = 0; i < count; i++)
93 for (var i = 0; i < count; i++)
94 pieSeries.append("slice" + i, Math.random());
94 pieSeries.append("slice" + i, Math.random());
95 for (var j = 0; j < count; j++)
95 for (var j = 0; j < count; j++)
96 compare(pieSeries.find("slice" + j).label, "slice" + j);
96 compare(pieSeries.find("slice" + j).label, "slice" + j);
97 pieSeries.clear();
97 pieSeries.clear();
98 }
98 }
99 }
99 }
100
100
101 ChartView {
101 ChartView {
102 id: chartView
102 id: chartView
103 anchors.fill: parent
103 anchors.fill: parent
104
104
105 PieSeries {
105 PieSeries {
106 id: pieSeries
106 id: pieSeries
107 name: "pie"
107 name: "pie"
108
108
109 SignalSpy {
109 SignalSpy {
110 id: addedSpy
110 id: addedSpy
111 target: pieSeries
111 target: pieSeries
112 signalName: "added"
112 signalName: "added"
113 }
113 }
114 SignalSpy {
114 SignalSpy {
115 id: removedSpy
115 id: removedSpy
116 target: pieSeries
116 target: pieSeries
117 signalName: "removed"
117 signalName: "removed"
118 }
118 }
119 SignalSpy {
119 SignalSpy {
120 id: sumChangedSpy
120 id: sumChangedSpy
121 target: pieSeries
121 target: pieSeries
122 signalName: "sumChanged"
122 signalName: "sumChanged"
123 }
123 }
124 SignalSpy {
124 SignalSpy {
125 id: countChangedSpy
125 id: countChangedSpy
126 target: pieSeries
126 target: pieSeries
127 signalName: "countChanged"
127 signalName: "countChanged"
128 }
128 }
129 }
129 }
130 }
130 }
131 }
131 }
@@ -1,117 +1,116
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2013 Digia Plc
3 ** Copyright (C) 2013 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Enterprise Charts Add-on.
7 ** This file is part of the Qt Enterprise Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise License Agreement provided with the
11 ** accordance with the Qt Enterprise License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 import QtQuick 1.0
21 import QtQuick 2.0
22 import QtQuickTest 1.0
22 import QtTest 1.0
23 import QtCommercial.Chart 1.2
23 import QtCommercial.Chart 1.3
24
24
25 Rectangle {
25 Rectangle {
26 width: 400
26 width: 400
27 height: 300
27 height: 300
28
28
29 TestCase {
29 TestCase {
30 id: tc1
30 id: tc1
31 name: "tst_qml-qtquicktest ValueAxis"
31 name: "tst_qml-qtquicktest ValueAxis"
32 when: windowShown
32 when: windowShown
33
33
34 function test_properties() {
34 // test functions are run in alphabetical order, the name has 'a' so that it
35 // will be the first function to execute.
36 function test_a_properties() {
35 // Default properties
37 // Default properties
36 verify(axisX.min < 0, "AxisX min");
38 verify(axisX.min < 0, "AxisX min");
37 verify(axisX.max > 0, "AxisX max");
39 verify(axisX.max > 0, "AxisX max");
38 verify(axisY.min < 0, "AxisY min");
40 verify(axisY.min < 0, "AxisY min");
39 verify(axisY.max > 0, "AxisY max");
41 verify(axisY.max > 0, "AxisY max");
40 verify(axisX.tickCount > 0, "AxisX tick count");
42 verify(axisX.tickCount == 5, "AxisX tick count");
41 verify(axisY.tickCount > 0, "AxisX tick count");
43 verify(axisY.tickCount == 5, "AxisY tick count");
42 compare(axisX.niceNumbersEnabled, false, "nice numbers");
44 verify(axisX.labelFormat == "", "label format");
43 compare(axisX.labelFormat, "", "label format");
44
45
45 // Modify properties
46 // Modify properties
46 axisX.tickCount = 3;
47 axisX.tickCount = 3;
47 compare(axisX.tickCount, 3, "set tick count");
48 verify(axisX.tickCount == 3, "set tick count");
48 axisX.niceNumbersEnabled = true;
49 compare(axisX.niceNumbersEnabled, true, "nice numbers");
50 }
49 }
51
50
52 function test_functions() {
51 function test_functions() {
53 // Set the axis ranges to not "nice" ones...
52 // Set the axis ranges to not "nice" ones...
54 var min = 0.032456456;
53 var min = 0.032456456;
55 var max = 10.67845634;
54 var max = 10.67845634;
56 axisX.max = min;
55 axisX.min = min;
57 axisX.max = max;
56 axisX.max = max;
58 axisY.max = min;
57 axisY.min = min;
59 axisY.max = max;
58 axisY.max = max;
60
59
61 // ...And then apply nice numbers and verify the range was changed
60 // ...And then apply nice numbers and verify the range was changed
62 axisX.applyNiceNumbers();
61 axisX.applyNiceNumbers();
63 axisY.applyNiceNumbers();
62 axisY.applyNiceNumbers();
64 verify(axisX.min != min);
63 verify(axisX.min != min);
65 verify(axisX.max != max);
64 verify(axisX.max != max);
66 verify(axisY.min != min);
65 verify(axisY.min != min);
67 verify(axisY.max != max);
66 verify(axisY.max != max);
68 }
67 }
69
68
70 function test_signals() {
69 function test_signals() {
71 minChangedSpy.clear();
70 minChangedSpy.clear();
72 maxChangedSpy.clear();
71 maxChangedSpy.clear();
73 axisX.min = 2;
72 axisX.min = 2;
74 compare(minChangedSpy.count, 1, "onMinChanged");
73 compare(minChangedSpy.count, 1, "onMinChanged");
75 compare(maxChangedSpy.count, 0, "onMaxChanged");
74 compare(maxChangedSpy.count, 0, "onMaxChanged");
76
75
77 axisX.max = 8;
76 axisX.max = 8;
78 compare(minChangedSpy.count, 1, "onMinChanged");
77 compare(minChangedSpy.count, 1, "onMinChanged");
79 compare(maxChangedSpy.count, 1, "onMaxChanged");
78 compare(maxChangedSpy.count, 1, "onMaxChanged");
80
79
81 // restore original values
80 // restore original values
82 axisX.min = 0;
81 axisX.min = 0;
83 axisX.max = 10;
82 axisX.max = 10;
84 compare(minChangedSpy.count, 2, "onMinChanged");
83 compare(minChangedSpy.count, 2, "onMinChanged");
85 compare(maxChangedSpy.count, 2, "onMaxChanged");
84 compare(maxChangedSpy.count, 2, "onMaxChanged");
86 }
85 }
87 }
86 }
88
87
89 ChartView {
88 ChartView {
90 id: chartView
89 id: chartView
91 anchors.fill: parent
90 anchors.fill: parent
92
91
93 LineSeries {
92 LineSeries {
94 id: lineSeries1
93 id: lineSeries1
95 axisX: ValueAxis {
94 axisX: ValueAxis {
96 id: axisX
95 id: axisX
97 }
96 }
98 axisY: ValueAxis {
97 axisY: ValueAxis {
99 id: axisY
98 id: axisY
100 }
99 }
101 XYPoint { x: -1; y: -1 }
100 XYPoint { x: -1; y: -1 }
102 XYPoint { x: 0; y: 0 }
101 XYPoint { x: 0; y: 0 }
103 XYPoint { x: 5; y: 5 }
102 XYPoint { x: 5; y: 5 }
104 }
103 }
105
104
106 SignalSpy {
105 SignalSpy {
107 id: minChangedSpy
106 id: minChangedSpy
108 target: axisX
107 target: axisX
109 signalName: "minChanged"
108 signalName: "minChanged"
110 }
109 }
111 SignalSpy {
110 SignalSpy {
112 id: maxChangedSpy
111 id: maxChangedSpy
113 target: axisX
112 target: axisX
114 signalName: "maxChanged"
113 signalName: "maxChanged"
115 }
114 }
116 }
115 }
117 }
116 }
@@ -1,63 +1,63
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2013 Digia Plc
3 ** Copyright (C) 2013 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Enterprise Charts Add-on.
7 ** This file is part of the Qt Enterprise Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise License Agreement provided with the
11 ** accordance with the Qt Enterprise License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 import QtQuick 1.0
21 import QtQuick 2.0
22 import QtQuickTest 1.0
22 import QtTest 1.0
23 import QtCommercial.Chart 1.1
23 import QtCommercial.Chart 1.1
24
24
25 Rectangle {
25 Rectangle {
26 width: 400
26 width: 400
27 height: 300
27 height: 300
28
28
29 TestCase {
29 TestCase {
30 id: tc1
30 id: tc1
31 name: "tst_qml-qtquicktest ValueAxis 1.1"
31 name: "tst_qml-qtquicktest ValueAxis 1.1"
32 when: windowShown
32 when: windowShown
33
33
34 function test_minMax() {
34 function test_minMax() {
35 compare(lineSeries1.axisX.min, 0, "AxisX min");
35 compare(lineSeries1.axisX.min, 0, "AxisX min");
36 compare(lineSeries1.axisX.max, 10, "AxisX max");
36 compare(lineSeries1.axisX.max, 10, "AxisX max");
37 compare(lineSeries1.axisY.min, 0, "AxisY min");
37 compare(lineSeries1.axisY.min, 0, "AxisY min");
38 compare(lineSeries1.axisY.max, 10, "AxisY max");
38 compare(lineSeries1.axisY.max, 10, "AxisY max");
39 }
39 }
40 }
40 }
41
41
42 ChartView {
42 ChartView {
43 id: chartView
43 id: chartView
44 anchors.fill: parent
44 anchors.fill: parent
45
45
46 LineSeries {
46 LineSeries {
47 id: lineSeries1
47 id: lineSeries1
48 axisX: ValueAxis {
48 axisX: ValueAxis {
49 id: axisX
49 id: axisX
50 min: 0
50 min: 0
51 max: 10
51 max: 10
52 }
52 }
53 axisY: ValueAxis {
53 axisY: ValueAxis {
54 id: axisY
54 id: axisY
55 min: 0
55 min: 0
56 max: 10
56 max: 10
57 }
57 }
58 XYPoint { x: -1; y: -1 }
58 XYPoint { x: -1; y: -1 }
59 XYPoint { x: 0; y: 0 }
59 XYPoint { x: 0; y: 0 }
60 XYPoint { x: 5; y: 5 }
60 XYPoint { x: 5; y: 5 }
61 }
61 }
62 }
62 }
63 }
63 }
@@ -1,271 +1,260
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2013 Digia Plc
3 ** Copyright (C) 2013 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Enterprise Charts Add-on.
7 ** This file is part of the Qt Enterprise Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise License Agreement provided with the
11 ** accordance with the Qt Enterprise License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 import QtQuick 1.0
21 import QtQuick 2.0
22 import QtQuickTest 1.0
22 import QtTest 1.0
23 import QtCommercial.Chart 1.2
23 import QtCommercial.Chart 1.3
24
24
25 Rectangle {
25 Rectangle {
26 width: 400
26 width: 400
27 height: 300
27 height: 300
28
28
29 TestCase {
29 TestCase {
30 id: tc1
30 id: tc1
31 name: "tst_qml-qtquicktest XY Series"
31 name: "tst_qml-qtquicktest XY Series"
32 when: windowShown
32 when: windowShown
33
33
34 function test_properties() {
34 function test_properties() {
35 verify(lineSeries.color != undefined);
35 verify(lineSeries.color != undefined);
36 compare(lineSeries.pointsVisible, false);
36 compare(lineSeries.pointsVisible, false);
37 compare(lineSeries.capStyle, Qt.SquareCap);
37 compare(lineSeries.capStyle, Qt.SquareCap);
38 compare(lineSeries.style, Qt.SolidLine);
38 compare(lineSeries.style, Qt.SolidLine);
39 compare(lineSeries.width, 2.0);
39 compare(lineSeries.width, 2.0);
40
40
41 verify(splineSeries.color != undefined);
41 verify(splineSeries.color != undefined);
42 compare(splineSeries.pointsVisible, false);
42 compare(splineSeries.pointsVisible, false);
43 compare(splineSeries.capStyle, Qt.SquareCap);
43 compare(splineSeries.capStyle, Qt.SquareCap);
44 compare(splineSeries.style, Qt.SolidLine);
44 compare(splineSeries.style, Qt.SolidLine);
45 compare(splineSeries.width, 2.0);
45 compare(splineSeries.width, 2.0);
46
46
47 verify(scatterSeries.color != undefined);
47 verify(scatterSeries.color != undefined);
48 verify(scatterSeries.borderColor != undefined);
48 verify(scatterSeries.borderColor != undefined);
49 compare(scatterSeries.borderWidth, 2.0);
49 compare(scatterSeries.borderWidth, 2.0);
50 compare(scatterSeries.markerShape, ScatterSeries.MarkerShapeCircle);
50 compare(scatterSeries.markerShape, ScatterSeries.MarkerShapeCircle);
51 compare(scatterSeries.markerSize, 15.0);
51 compare(scatterSeries.markerSize, 15.0);
52
52
53 verify(areaSeries.color != undefined);
53 verify(areaSeries.color != undefined);
54 verify(areaSeries.borderColor != undefined);
54 verify(areaSeries.borderColor != undefined);
55 compare(areaSeries.borderWidth, 2.0);
55 compare(areaSeries.borderWidth, 2.0);
56 }
56 }
57
57
58 function test_axes() {
58 function test_axes() {
59 // Axis initialization
59 // Axis initialization
60 compare(chartView.axes.length, 2);
60 compare(chartView.axisX(), lineSeries.axisX);
61 verify(chartView.axes[0] == lineSeries.axisX || chartView.axes[1] == lineSeries.axisX);
61 compare(chartView.axisY(), lineSeries.axisY);
62 verify(chartView.axes[0] == lineSeries.axisY || chartView.axes[1] == lineSeries.axisY);
63 compare(lineSeries.axisX, splineSeries.axisX);
62 compare(lineSeries.axisX, splineSeries.axisX);
64 compare(lineSeries.axisY, splineSeries.axisY);
63 compare(lineSeries.axisY, splineSeries.axisY);
65 compare(lineSeries.axisX, areaSeries.axisX);
64 compare(lineSeries.axisX, areaSeries.axisX);
66 compare(lineSeries.axisY, areaSeries.axisY);
65 compare(lineSeries.axisY, areaSeries.axisY);
67
68 // Set illegal axes
69 lineSeries.axisX = lineSeries.axisY;
70 compare(lineSeries.axisX, splineSeries.axisX);
71 lineSeries.axisXTop = lineSeries.axisX;
72 compare(lineSeries.axisX, splineSeries.axisX);
73 lineSeries.axisY = lineSeries.axisX;
74 compare(lineSeries.axisY, splineSeries.axisY);
75 lineSeries.axisYRight = lineSeries.axisY;
76 compare(lineSeries.axisY, splineSeries.axisY);
77 }
66 }
78
67
79 function test_append() {
68 function test_append() {
80 lineSeriesPointAddedSpy.clear();
69 lineSeriesPointAddedSpy.clear();
81 splineSeriesPointAddedSpy.clear();
70 splineSeriesPointAddedSpy.clear();
82 scatterSeriesPointAddedSpy.clear();
71 scatterSeriesPointAddedSpy.clear();
83 var count = append();
72 var count = append();
84 compare(lineSeries.count, count);
73 compare(lineSeries.count, count);
85 compare(splineSeries.count, count);
74 compare(splineSeries.count, count);
86 compare(scatterSeries.count, count);
75 compare(scatterSeries.count, count);
87 tryCompare(lineSeriesPointAddedSpy.count, count);
76 compare(lineSeriesPointAddedSpy.count, count);
88 tryCompare(splineSeriesPointAddedSpy.count, count);
77 compare(splineSeriesPointAddedSpy.count, count);
89 tryCompare(scatterSeriesPointAddedSpy.count, count);
78 compare(scatterSeriesPointAddedSpy.count, count);
90 clear();
79 clear();
91 compare(lineSeries.count, 0);
80 compare(lineSeries.count, 0);
92 compare(splineSeries.count, 0);
81 compare(splineSeries.count, 0);
93 compare(scatterSeries.count, 0);
82 compare(scatterSeries.count, 0);
94 }
83 }
95
84
96 function test_replace() {
85 function test_replace() {
97 var count = append();
86 var count = append();
98 for (var i = 0; i < count; i++) {
87 for (var i = 0; i < count; i++) {
99 lineSeries.replace(lineSeries.at(i).x, lineSeries.at(i).y, i, Math.random());
88 lineSeries.replace(lineSeries.at(i).x, lineSeries.at(i).y, i, Math.random());
100 splineSeries.replace(splineSeries.at(i).x, splineSeries.at(i).y, i, Math.random());
89 splineSeries.replace(splineSeries.at(i).x, splineSeries.at(i).y, i, Math.random());
101 scatterSeries.replace(scatterSeries.at(i).x, scatterSeries.at(i).y, i, Math.random());
90 scatterSeries.replace(scatterSeries.at(i).x, scatterSeries.at(i).y, i, Math.random());
102 }
91 }
103 compare(lineSeries.count, count);
92 compare(lineSeries.count, count);
104 compare(splineSeries.count, count);
93 compare(splineSeries.count, count);
105 compare(scatterSeries.count, count);
94 compare(scatterSeries.count, count);
106 tryCompare(lineSeriesPointReplacedSpy.count, count);
95 compare(lineSeriesPointReplacedSpy.count, count);
107 tryCompare(splineSeriesPointReplacedSpy.count, count);
96 compare(splineSeriesPointReplacedSpy.count, count);
108 tryCompare(scatterSeriesPointReplacedSpy.count, count);
97 compare(scatterSeriesPointReplacedSpy.count, count);
109 clear();
98 clear();
110 }
99 }
111
100
112 function test_insert() {
101 function test_insert() {
113 var count = append();
102 var count = append();
114 lineSeriesPointAddedSpy.clear();
103 lineSeriesPointAddedSpy.clear();
115 splineSeriesPointAddedSpy.clear();
104 splineSeriesPointAddedSpy.clear();
116 scatterSeriesPointAddedSpy.clear();
105 scatterSeriesPointAddedSpy.clear();
117 for (var i = 0; i < count; i++) {
106 for (var i = 0; i < count; i++) {
118 lineSeries.insert(i * 2, i, Math.random());
107 lineSeries.insert(i * 2, i, Math.random());
119 splineSeries.insert(i * 2, i, Math.random());
108 splineSeries.insert(i * 2, i, Math.random());
120 scatterSeries.insert(i * 2, i, Math.random());
109 scatterSeries.insert(i * 2, i, Math.random());
121 }
110 }
122 compare(lineSeries.count, count * 2);
111 compare(lineSeries.count, count * 2);
123 compare(splineSeries.count, count * 2);
112 compare(splineSeries.count, count * 2);
124 compare(scatterSeries.count, count * 2);
113 compare(scatterSeries.count, count * 2);
125 tryCompare(lineSeriesPointAddedSpy.count, count);
114 compare(lineSeriesPointAddedSpy.count, count);
126 tryCompare(splineSeriesPointAddedSpy.count, count);
115 compare(splineSeriesPointAddedSpy.count, count);
127 tryCompare(scatterSeriesPointAddedSpy.count, count);
116 compare(scatterSeriesPointAddedSpy.count, count);
128 clear();
117 clear();
129 }
118 }
130
119
131 function test_remove() {
120 function test_remove() {
132 lineSeriesPointRemovedSpy.clear();
121 lineSeriesPointRemovedSpy.clear();
133 splineSeriesPointRemovedSpy.clear();
122 splineSeriesPointRemovedSpy.clear();
134 scatterSeriesPointRemovedSpy.clear();
123 scatterSeriesPointRemovedSpy.clear();
135 var count = append();
124 var count = append();
136 for (var i = 0; i < count; i++) {
125 for (var i = 0; i < count; i++) {
137 lineSeries.remove(lineSeries.at(0).x, lineSeries.at(0).y);
126 lineSeries.remove(lineSeries.at(0).x, lineSeries.at(0).y);
138 splineSeries.remove(splineSeries.at(0).x, splineSeries.at(0).y);
127 splineSeries.remove(splineSeries.at(0).x, splineSeries.at(0).y);
139 scatterSeries.remove(scatterSeries.at(0).x, scatterSeries.at(0).y);
128 scatterSeries.remove(scatterSeries.at(0).x, scatterSeries.at(0).y);
140 }
129 }
141 compare(lineSeries.count, 0);
130 compare(lineSeries.count, 0);
142 compare(splineSeries.count, 0);
131 compare(splineSeries.count, 0);
143 compare(scatterSeries.count, 0);
132 compare(scatterSeries.count, 0);
144 tryCompare(lineSeriesPointRemovedSpy.count, count);
133 compare(lineSeriesPointRemovedSpy.count, count);
145 tryCompare(splineSeriesPointRemovedSpy.count, count);
134 compare(splineSeriesPointRemovedSpy.count, count);
146 tryCompare(scatterSeriesPointRemovedSpy.count, count);
135 compare(scatterSeriesPointRemovedSpy.count, count);
147 }
136 }
148
137
149 // Not a test function, called from test functions
138 // Not a test function, called from test functions
150 function append() {
139 function append() {
151 var count = 100;
140 var count = 100;
152 chartView.axisX().min = 0;
141 chartView.axisX().min = 0;
153 chartView.axisX().max = 100;
142 chartView.axisX().max = 100;
154 chartView.axisY().min = 0;
143 chartView.axisY().min = 0;
155 chartView.axisY().max = 1;
144 chartView.axisY().max = 1;
156
145
157 for (var i = 0; i < count; i++) {
146 for (var i = 0; i < count; i++) {
158 lineSeries.append(i, Math.random());
147 lineSeries.append(i, Math.random());
159 splineSeries.append(i, Math.random());
148 splineSeries.append(i, Math.random());
160 scatterSeries.append(i, Math.random());
149 scatterSeries.append(i, Math.random());
161 }
150 }
162
151
163 return count;
152 return count;
164 }
153 }
165
154
166 // Not a test function, called from test functions
155 // Not a test function, called from test functions
167 function clear() {
156 function clear() {
168 lineSeries.clear();
157 lineSeries.clear();
169 splineSeries.clear();
158 splineSeries.clear();
170 scatterSeries.clear();
159 scatterSeries.clear();
171 }
160 }
172 }
161 }
173
162
174 ChartView {
163 ChartView {
175 id: chartView
164 id: chartView
176 anchors.fill: parent
165 anchors.fill: parent
177
166
178 LineSeries {
167 LineSeries {
179 id: lineSeries
168 id: lineSeries
180 name: "line"
169 name: "line"
181
170
182 SignalSpy {
171 SignalSpy {
183 id: lineSeriesPointAddedSpy
172 id: lineSeriesPointAddedSpy
184 target: lineSeries
173 target: lineSeries
185 signalName: "pointAdded"
174 signalName: "pointAdded"
186 }
175 }
187
176
188 SignalSpy {
177 SignalSpy {
189 id: lineSeriesPointReplacedSpy
178 id: lineSeriesPointReplacedSpy
190 target: lineSeries
179 target: lineSeries
191 signalName: "pointReplaced"
180 signalName: "pointReplaced"
192 }
181 }
193
182
194 SignalSpy {
183 SignalSpy {
195 id: lineSeriesPointsReplacedSpy
184 id: lineSeriesPointsReplacedSpy
196 target: lineSeries
185 target: lineSeries
197 signalName: "pointsReplaced"
186 signalName: "pointsReplaced"
198 }
187 }
199
188
200 SignalSpy {
189 SignalSpy {
201 id: lineSeriesPointRemovedSpy
190 id: lineSeriesPointRemovedSpy
202 target: lineSeries
191 target: lineSeries
203 signalName: "pointRemoved"
192 signalName: "pointRemoved"
204 }
193 }
205 }
194 }
206
195
207 AreaSeries {
196 AreaSeries {
208 id: areaSeries
197 id: areaSeries
209 name: "area"
198 name: "area"
210 upperSeries: lineSeries
199 upperSeries: lineSeries
211 }
200 }
212
201
213 SplineSeries {
202 SplineSeries {
214 id: splineSeries
203 id: splineSeries
215 name: "spline"
204 name: "spline"
216
205
217 SignalSpy {
206 SignalSpy {
218 id: splineSeriesPointAddedSpy
207 id: splineSeriesPointAddedSpy
219 target: splineSeries
208 target: splineSeries
220 signalName: "pointAdded"
209 signalName: "pointAdded"
221 }
210 }
222
211
223 SignalSpy {
212 SignalSpy {
224 id: splineSeriesPointReplacedSpy
213 id: splineSeriesPointReplacedSpy
225 target: splineSeries
214 target: splineSeries
226 signalName: "pointReplaced"
215 signalName: "pointReplaced"
227 }
216 }
228
217
229 SignalSpy {
218 SignalSpy {
230 id: splineSeriesPointsReplacedSpy
219 id: splineSeriesPointsReplacedSpy
231 target: splineSeries
220 target: splineSeries
232 signalName: "pointsReplaced"
221 signalName: "pointsReplaced"
233 }
222 }
234
223
235 SignalSpy {
224 SignalSpy {
236 id: splineSeriesPointRemovedSpy
225 id: splineSeriesPointRemovedSpy
237 target: splineSeries
226 target: splineSeries
238 signalName: "pointRemoved"
227 signalName: "pointRemoved"
239 }
228 }
240 }
229 }
241
230
242 ScatterSeries {
231 ScatterSeries {
243 id: scatterSeries
232 id: scatterSeries
244 name: "scatter"
233 name: "scatter"
245
234
246 SignalSpy {
235 SignalSpy {
247 id: scatterSeriesPointAddedSpy
236 id: scatterSeriesPointAddedSpy
248 target: scatterSeries
237 target: scatterSeries
249 signalName: "pointAdded"
238 signalName: "pointAdded"
250 }
239 }
251
240
252 SignalSpy {
241 SignalSpy {
253 id: scatterSeriesPointReplacedSpy
242 id: scatterSeriesPointReplacedSpy
254 target: scatterSeries
243 target: scatterSeries
255 signalName: "pointReplaced"
244 signalName: "pointReplaced"
256 }
245 }
257
246
258 SignalSpy {
247 SignalSpy {
259 id: scatterSeriesPointsReplacedSpy
248 id: scatterSeriesPointsReplacedSpy
260 target: scatterSeries
249 target: scatterSeries
261 signalName: "pointsReplaced"
250 signalName: "pointsReplaced"
262 }
251 }
263
252
264 SignalSpy {
253 SignalSpy {
265 id: scatterSeriesPointRemovedSpy
254 id: scatterSeriesPointRemovedSpy
266 target: scatterSeries
255 target: scatterSeries
267 signalName: "pointRemoved"
256 signalName: "pointRemoved"
268 }
257 }
269 }
258 }
270 }
259 }
271 }
260 }
@@ -1,250 +1,250
1 /****************************************************************************
1 /****************************************************************************
2 **
2 **
3 ** Copyright (C) 2013 Digia Plc
3 ** Copyright (C) 2013 Digia Plc
4 ** All rights reserved.
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
6 **
7 ** This file is part of the Qt Enterprise Charts Add-on.
7 ** This file is part of the Qt Enterprise Charts Add-on.
8 **
8 **
9 ** $QT_BEGIN_LICENSE$
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
10 ** Licensees holding valid Qt Enterprise licenses may use this file in
11 ** accordance with the Qt Enterprise License Agreement provided with the
11 ** accordance with the Qt Enterprise License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
13 ** a written agreement between you and Digia.
14 **
14 **
15 ** If you have questions regarding the use of this file, please use
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
17 ** $QT_END_LICENSE$
18 **
18 **
19 ****************************************************************************/
19 ****************************************************************************/
20
20
21 import QtQuick 1.0
21 import QtQuick 2.0
22 import QtQuickTest 1.0
22 import QtTest 1.0
23 import QtCommercial.Chart 1.1
23 import QtCommercial.Chart 1.1
24
24
25 Rectangle {
25 Rectangle {
26 width: 400
26 width: 400
27 height: 300
27 height: 300
28
28
29 TestCase {
29 TestCase {
30 id: tc1
30 id: tc1
31 name: "tst_qml-qtquicktest XY Series 1.1"
31 name: "tst_qml-qtquicktest XY Series 1.1"
32 when: windowShown
32 when: windowShown
33
33
34 function test_properties() {
34 function test_properties() {
35 verify(lineSeries.color != undefined);
35 verify(lineSeries.color != undefined);
36 compare(lineSeries.pointsVisible, false);
36 compare(lineSeries.pointsVisible, false);
37 compare(lineSeries.capStyle, Qt.SquareCap);
37 compare(lineSeries.capStyle, Qt.SquareCap);
38 compare(lineSeries.style, Qt.SolidLine);
38 compare(lineSeries.style, Qt.SolidLine);
39 compare(lineSeries.width, 2.0);
39 compare(lineSeries.width, 2.0);
40
40
41 verify(splineSeries.color != undefined);
41 verify(splineSeries.color != undefined);
42 compare(splineSeries.pointsVisible, false);
42 compare(splineSeries.pointsVisible, false);
43 compare(splineSeries.capStyle, Qt.SquareCap);
43 compare(splineSeries.capStyle, Qt.SquareCap);
44 compare(splineSeries.style, Qt.SolidLine);
44 compare(splineSeries.style, Qt.SolidLine);
45 compare(splineSeries.width, 2.0);
45 compare(splineSeries.width, 2.0);
46
46
47 verify(scatterSeries.color != undefined);
47 verify(scatterSeries.color != undefined);
48 verify(scatterSeries.borderColor != undefined);
48 verify(scatterSeries.borderColor != undefined);
49 compare(scatterSeries.borderWidth, 2.0);
49 compare(scatterSeries.borderWidth, 2.0);
50 compare(scatterSeries.markerShape, ScatterSeries.MarkerShapeCircle);
50 compare(scatterSeries.markerShape, ScatterSeries.MarkerShapeCircle);
51 compare(scatterSeries.markerSize, 15.0);
51 compare(scatterSeries.markerSize, 15.0);
52
52
53 verify(areaSeries.color != undefined);
53 verify(areaSeries.color != undefined);
54 verify(areaSeries.borderColor != undefined);
54 verify(areaSeries.borderColor != undefined);
55 compare(areaSeries.borderWidth, 2.0);
55 compare(areaSeries.borderWidth, 2.0);
56 }
56 }
57
57
58 function test_append() {
58 function test_append() {
59 lineSeriesPointAddedSpy.clear();
59 lineSeriesPointAddedSpy.clear();
60 splineSeriesPointAddedSpy.clear();
60 splineSeriesPointAddedSpy.clear();
61 scatterSeriesPointAddedSpy.clear();
61 scatterSeriesPointAddedSpy.clear();
62 var count = append();
62 var count = append();
63 compare(lineSeries.count, count);
63 compare(lineSeries.count, count);
64 compare(splineSeries.count, count);
64 compare(splineSeries.count, count);
65 compare(scatterSeries.count, count);
65 compare(scatterSeries.count, count);
66 tryCompare(lineSeriesPointAddedSpy.count, count);
66 compare(lineSeriesPointAddedSpy.count, count);
67 tryCompare(splineSeriesPointAddedSpy.count, count);
67 compare(splineSeriesPointAddedSpy.count, count);
68 tryCompare(scatterSeriesPointAddedSpy.count, count);
68 compare(scatterSeriesPointAddedSpy.count, count);
69 clear();
69 clear();
70 compare(lineSeries.count, 0);
70 compare(lineSeries.count, 0);
71 compare(splineSeries.count, 0);
71 compare(splineSeries.count, 0);
72 compare(scatterSeries.count, 0);
72 compare(scatterSeries.count, 0);
73 }
73 }
74
74
75 function test_replace() {
75 function test_replace() {
76 var count = append();
76 var count = append();
77 for (var i = 0; i < count; i++) {
77 for (var i = 0; i < count; i++) {
78 lineSeries.replace(lineSeries.at(i).x, lineSeries.at(i).y, i, Math.random());
78 lineSeries.replace(lineSeries.at(i).x, lineSeries.at(i).y, i, Math.random());
79 splineSeries.replace(splineSeries.at(i).x, splineSeries.at(i).y, i, Math.random());
79 splineSeries.replace(splineSeries.at(i).x, splineSeries.at(i).y, i, Math.random());
80 scatterSeries.replace(scatterSeries.at(i).x, scatterSeries.at(i).y, i, Math.random());
80 scatterSeries.replace(scatterSeries.at(i).x, scatterSeries.at(i).y, i, Math.random());
81 }
81 }
82 compare(lineSeries.count, count);
82 compare(lineSeries.count, count);
83 compare(splineSeries.count, count);
83 compare(splineSeries.count, count);
84 compare(scatterSeries.count, count);
84 compare(scatterSeries.count, count);
85 tryCompare(lineSeriesPointReplacedSpy.count, count);
85 compare(lineSeriesPointReplacedSpy.count, count);
86 tryCompare(splineSeriesPointReplacedSpy.count, count);
86 compare(splineSeriesPointReplacedSpy.count, count);
87 tryCompare(scatterSeriesPointReplacedSpy.count, count);
87 compare(scatterSeriesPointReplacedSpy.count, count);
88 clear();
88 clear();
89 }
89 }
90
90
91 function test_insert() {
91 function test_insert() {
92 var count = append();
92 var count = append();
93 lineSeriesPointAddedSpy.clear();
93 lineSeriesPointAddedSpy.clear();
94 splineSeriesPointAddedSpy.clear();
94 splineSeriesPointAddedSpy.clear();
95 scatterSeriesPointAddedSpy.clear();
95 scatterSeriesPointAddedSpy.clear();
96 for (var i = 0; i < count; i++) {
96 for (var i = 0; i < count; i++) {
97 lineSeries.insert(i * 2, i, Math.random());
97 lineSeries.insert(i * 2, i, Math.random());
98 splineSeries.insert(i * 2, i, Math.random());
98 splineSeries.insert(i * 2, i, Math.random());
99 scatterSeries.insert(i * 2, i, Math.random());
99 scatterSeries.insert(i * 2, i, Math.random());
100 }
100 }
101 compare(lineSeries.count, count * 2);
101 compare(lineSeries.count, count * 2);
102 compare(splineSeries.count, count * 2);
102 compare(splineSeries.count, count * 2);
103 compare(scatterSeries.count, count * 2);
103 compare(scatterSeries.count, count * 2);
104 tryCompare(lineSeriesPointAddedSpy.count, count);
104 compare(lineSeriesPointAddedSpy.count, count);
105 tryCompare(splineSeriesPointAddedSpy.count, count);
105 compare(splineSeriesPointAddedSpy.count, count);
106 tryCompare(scatterSeriesPointAddedSpy.count, count);
106 compare(scatterSeriesPointAddedSpy.count, count);
107 clear();
107 clear();
108 }
108 }
109
109
110 function test_remove() {
110 function test_remove() {
111 lineSeriesPointRemovedSpy.clear();
111 lineSeriesPointRemovedSpy.clear();
112 splineSeriesPointRemovedSpy.clear();
112 splineSeriesPointRemovedSpy.clear();
113 scatterSeriesPointRemovedSpy.clear();
113 scatterSeriesPointRemovedSpy.clear();
114 var count = append();
114 var count = append();
115 for (var i = 0; i < count; i++) {
115 for (var i = 0; i < count; i++) {
116 lineSeries.remove(lineSeries.at(0).x, lineSeries.at(0).y);
116 lineSeries.remove(lineSeries.at(0).x, lineSeries.at(0).y);
117 splineSeries.remove(splineSeries.at(0).x, splineSeries.at(0).y);
117 splineSeries.remove(splineSeries.at(0).x, splineSeries.at(0).y);
118 scatterSeries.remove(scatterSeries.at(0).x, scatterSeries.at(0).y);
118 scatterSeries.remove(scatterSeries.at(0).x, scatterSeries.at(0).y);
119 }
119 }
120 compare(lineSeries.count, 0);
120 compare(lineSeries.count, 0);
121 compare(splineSeries.count, 0);
121 compare(splineSeries.count, 0);
122 compare(scatterSeries.count, 0);
122 compare(scatterSeries.count, 0);
123 tryCompare(lineSeriesPointRemovedSpy.count, count);
123 compare(lineSeriesPointRemovedSpy.count, count);
124 tryCompare(splineSeriesPointRemovedSpy.count, count);
124 compare(splineSeriesPointRemovedSpy.count, count);
125 tryCompare(scatterSeriesPointRemovedSpy.count, count);
125 compare(scatterSeriesPointRemovedSpy.count, count);
126 }
126 }
127
127
128 // Not a test function, called from test functions
128 // Not a test function, called from test functions
129 function append() {
129 function append() {
130 var count = 100;
130 var count = 100;
131 chartView.axisX().min = 0;
131 chartView.axisX().min = 0;
132 chartView.axisX().max = 100;
132 chartView.axisX().max = 100;
133 chartView.axisY().min = 0;
133 chartView.axisY().min = 0;
134 chartView.axisY().max = 1;
134 chartView.axisY().max = 1;
135
135
136 for (var i = 0; i < count; i++) {
136 for (var i = 0; i < count; i++) {
137 lineSeries.append(i, Math.random());
137 lineSeries.append(i, Math.random());
138 splineSeries.append(i, Math.random());
138 splineSeries.append(i, Math.random());
139 scatterSeries.append(i, Math.random());
139 scatterSeries.append(i, Math.random());
140 }
140 }
141
141
142 return count;
142 return count;
143 }
143 }
144
144
145 // Not a test function, called from test functions
145 // Not a test function, called from test functions
146 function clear() {
146 function clear() {
147 lineSeries.clear();
147 lineSeries.clear();
148 splineSeries.clear();
148 splineSeries.clear();
149 scatterSeries.clear();
149 scatterSeries.clear();
150 }
150 }
151 }
151 }
152
152
153 ChartView {
153 ChartView {
154 id: chartView
154 id: chartView
155 anchors.fill: parent
155 anchors.fill: parent
156
156
157 LineSeries {
157 LineSeries {
158 id: lineSeries
158 id: lineSeries
159 name: "line"
159 name: "line"
160
160
161 SignalSpy {
161 SignalSpy {
162 id: lineSeriesPointAddedSpy
162 id: lineSeriesPointAddedSpy
163 target: lineSeries
163 target: lineSeries
164 signalName: "pointAdded"
164 signalName: "pointAdded"
165 }
165 }
166
166
167 SignalSpy {
167 SignalSpy {
168 id: lineSeriesPointReplacedSpy
168 id: lineSeriesPointReplacedSpy
169 target: lineSeries
169 target: lineSeries
170 signalName: "pointReplaced"
170 signalName: "pointReplaced"
171 }
171 }
172
172
173 SignalSpy {
173 SignalSpy {
174 id: lineSeriesPointsReplacedSpy
174 id: lineSeriesPointsReplacedSpy
175 target: lineSeries
175 target: lineSeries
176 signalName: "pointsReplaced"
176 signalName: "pointsReplaced"
177 }
177 }
178
178
179 SignalSpy {
179 SignalSpy {
180 id: lineSeriesPointRemovedSpy
180 id: lineSeriesPointRemovedSpy
181 target: lineSeries
181 target: lineSeries
182 signalName: "pointRemoved"
182 signalName: "pointRemoved"
183 }
183 }
184 }
184 }
185
185
186 AreaSeries {
186 AreaSeries {
187 id: areaSeries
187 id: areaSeries
188 name: "area"
188 name: "area"
189 upperSeries: lineSeries
189 upperSeries: lineSeries
190 }
190 }
191
191
192 SplineSeries {
192 SplineSeries {
193 id: splineSeries
193 id: splineSeries
194 name: "spline"
194 name: "spline"
195
195
196 SignalSpy {
196 SignalSpy {
197 id: splineSeriesPointAddedSpy
197 id: splineSeriesPointAddedSpy
198 target: splineSeries
198 target: splineSeries
199 signalName: "pointAdded"
199 signalName: "pointAdded"
200 }
200 }
201
201
202 SignalSpy {
202 SignalSpy {
203 id: splineSeriesPointReplacedSpy
203 id: splineSeriesPointReplacedSpy
204 target: splineSeries
204 target: splineSeries
205 signalName: "pointReplaced"
205 signalName: "pointReplaced"
206 }
206 }
207
207
208 SignalSpy {
208 SignalSpy {
209 id: splineSeriesPointsReplacedSpy
209 id: splineSeriesPointsReplacedSpy
210 target: splineSeries
210 target: splineSeries
211 signalName: "pointsReplaced"
211 signalName: "pointsReplaced"
212 }
212 }
213
213
214 SignalSpy {
214 SignalSpy {
215 id: splineSeriesPointRemovedSpy
215 id: splineSeriesPointRemovedSpy
216 target: splineSeries
216 target: splineSeries
217 signalName: "pointRemoved"
217 signalName: "pointRemoved"
218 }
218 }
219 }
219 }
220
220
221 ScatterSeries {
221 ScatterSeries {
222 id: scatterSeries
222 id: scatterSeries
223 name: "scatter"
223 name: "scatter"
224
224
225 SignalSpy {
225 SignalSpy {
226 id: scatterSeriesPointAddedSpy
226 id: scatterSeriesPointAddedSpy
227 target: scatterSeries
227 target: scatterSeries
228 signalName: "pointAdded"
228 signalName: "pointAdded"
229 }
229 }
230
230
231 SignalSpy {
231 SignalSpy {
232 id: scatterSeriesPointReplacedSpy
232 id: scatterSeriesPointReplacedSpy
233 target: scatterSeries
233 target: scatterSeries
234 signalName: "pointReplaced"
234 signalName: "pointReplaced"
235 }
235 }
236
236
237 SignalSpy {
237 SignalSpy {
238 id: scatterSeriesPointsReplacedSpy
238 id: scatterSeriesPointsReplacedSpy
239 target: scatterSeries
239 target: scatterSeries
240 signalName: "pointsReplaced"
240 signalName: "pointsReplaced"
241 }
241 }
242
242
243 SignalSpy {
243 SignalSpy {
244 id: scatterSeriesPointRemovedSpy
244 id: scatterSeriesPointRemovedSpy
245 target: scatterSeries
245 target: scatterSeries
246 signalName: "pointRemoved"
246 signalName: "pointRemoved"
247 }
247 }
248 }
248 }
249 }
249 }
250 }
250 }
General Comments 0
You need to be logged in to leave comments. Login now