##// END OF EJS Templates
QML API versioning to QtCommercial.Chart 1.1
Tero Ahola -
r1857:58a3a87ea08b
parent child
Show More
@@ -1,51 +1,51
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 Rectangle {
25 25 anchors.fill: parent
26 26 property variant othersSlice: 0
27 27
28 28 //![1]
29 29 ChartView {
30 30 id: chart
31 31 title: "Top-5 car brand shares in Finland"
32 32 anchors.fill: parent
33 33 legend.alignment: Qt.AlignBottom
34 34
35 35 PieSeries {
36 36 id: pieSeries
37 37 PieSlice { label: "Volkswagen"; value: 13.5 }
38 38 PieSlice { label: "Toyota"; value: 10.9 }
39 39 PieSlice { label: "Ford"; value: 8.6 }
40 40 PieSlice { label: "Skoda"; value: 8.2 }
41 41 PieSlice { label: "Volvo"; value: 6.8 }
42 42 }
43 43 }
44 44
45 45 Component.onCompleted: {
46 46 // You can also manipulate slices dynamically
47 47 othersSlice = pieSeries.append("Others", 52.0);
48 48 pieSeries.find("Volkswagen").exploded = true;
49 49 }
50 50 //![1]
51 51 }
@@ -1,41 +1,41
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 Rectangle {
25 25 anchors.fill: parent
26 26
27 27 //![1]
28 28 ChartView {
29 29 title: "Horizontal Stacked Bar series"
30 30 anchors.fill: parent
31 31 legend.alignment: Qt.AlignBottom
32 32
33 33 HorizontalStackedBarSeries {
34 axisY: BarCategoriesAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] }
34 axisY: BarCategoryAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] }
35 35 BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6] }
36 36 BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] }
37 37 BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] }
38 38 }
39 39 }
40 40 //![1]
41 41 }
@@ -1,42 +1,42
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 Rectangle {
25 25 anchors.fill: parent
26 26
27 27 //![1]
28 28 ChartView {
29 29 title: "Horizontal Percent Bar series"
30 30 anchors.fill: parent
31 31 legend.alignment: Qt.AlignBottom
32 32
33 33 HorizontalPercentBarSeries {
34 axisY: BarCategoriesAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] }
34 axisY: BarCategoryAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] }
35 35 BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6] }
36 36 BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] }
37 37 BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] }
38 38 }
39 39 }
40 40 //![1]
41 41 }
42 42
@@ -1,76 +1,76
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 Rectangle {
25 25 anchors.fill: parent
26 26
27 27 //![1]
28 28 ChartView {
29 29 id: chart
30 30 title: "Production costs"
31 31 anchors.fill: parent
32 32 legend.visible: false
33 33
34 34 PieSeries {
35 35 id: pieOuter
36 36 size: 0.96
37 37 holeSize: 0.7
38 38 PieSlice { id: slice; label: "Alpha"; value: 19511; color: "#8AB846"; borderColor: "#163430" }
39 39 PieSlice { label: "Epsilon"; value: 11105; color: "#C0EEFF"; borderColor: "#3B391C" }
40 40 PieSlice { label: "Psi"; value: 9352; color: "#DF8939"; borderColor: "#13060C" }
41 41 }
42 42
43 43 PieSeries {
44 44 size: 0.7
45 45 id: pieInner
46 46 holeSize: 0.25
47 47
48 48 PieSlice { label: "Materials"; value: 10334; color: "#8AB846"; borderColor: "#163430" }
49 49 PieSlice { label: "Employee"; value: 3066; color: "#AAE356"; borderColor: "#163430" }
50 50 PieSlice { label: "Logistics"; value: 6111; color: "#99CC4E"; borderColor: "#163430" }
51 51
52 52 PieSlice { label: "Materials"; value: 7371; color: "#C0EEFF"; borderColor: "#3B391C" }
53 53 PieSlice { label: "Employee"; value: 2443; color: "#C9FAFF"; borderColor: "#3B391C" }
54 54 PieSlice { label: "Logistics"; value: 1291; color: "#B0FAFF"; borderColor: "#3B391C" }
55 55
56 56 PieSlice { label: "Materials"; value: 4022; color: "#DF8939"; borderColor: "#13060C" }
57 57 PieSlice { label: "Employee"; value: 3998; color: "#FC9D42"; borderColor: "#13060C" }
58 58 PieSlice { label: "Logistics"; value: 1332; color: "#F2963F"; borderColor: "#13060C" }
59 59 }
60 60 }
61 61
62 62 Component.onCompleted: {
63 63 // Set the common slice properties dynamically for convenience
64 64 for (var i = 0; i < pieOuter.count; i++) {
65 65 pieOuter.at(i).labelPosition = PieSlice.LabelOutside;
66 66 pieOuter.at(i).labelVisible = true;
67 67 pieOuter.at(i).borderWidth = 3;
68 68 }
69 69 for (var i = 0; i < pieInner.count; i++) {
70 70 pieInner.at(i).labelPosition = PieSlice.LabelInsideNormal;
71 71 pieInner.at(i).labelVisible = true;
72 72 pieInner.at(i).borderWidth = 2;
73 73 }
74 74 }
75 75 //![1]
76 76 }
@@ -1,44 +1,44
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 Rectangle {
25 25 anchors.fill: parent
26 26
27 27 //![1]
28 28 ChartView {
29 29 title: "Line"
30 30 anchors.fill: parent
31 31
32 32 LineSeries {
33 33 name: "LineSeries"
34 34 XYPoint { x: 0; y: 0 }
35 35 XYPoint { x: 1.1; y: 2.1 }
36 36 XYPoint { x: 1.9; y: 3.3 }
37 37 XYPoint { x: 2.1; y: 2.1 }
38 38 XYPoint { x: 2.9; y: 4.9 }
39 39 XYPoint { x: 3.4; y: 3.0 }
40 40 XYPoint { x: 4.1; y: 3.3 }
41 41 }
42 42 }
43 43 //![1]
44 44 }
@@ -1,44 +1,44
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 Rectangle {
25 25 anchors.fill: parent
26 26
27 27 //![1]
28 28 ChartView {
29 29 title: "Spline"
30 30 anchors.fill: parent
31 31
32 32 SplineSeries {
33 33 name: "SplineSeries"
34 34 XYPoint { x: 0; y: 0.0 }
35 35 XYPoint { x: 1.1; y: 3.2 }
36 36 XYPoint { x: 1.9; y: 2.4 }
37 37 XYPoint { x: 2.1; y: 2.1 }
38 38 XYPoint { x: 2.9; y: 2.6 }
39 39 XYPoint { x: 3.4; y: 2.3 }
40 40 XYPoint { x: 4.1; y: 3.1 }
41 41 }
42 42 }
43 43 //![1]
44 44 }
@@ -1,101 +1,101
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 Rectangle {
25 25 anchors.fill: parent
26 26
27 27 //![1]
28 28 ChartView {
29 29 title: "NHL All-Star Team Players"
30 30 anchors.fill: parent
31 31
32 32 BarCategoriesAxis {
33 33 id: catergoriesAxis
34 34 categories: ["2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008",
35 35 "2009", "2010", "2011" ]
36 36 }
37 37
38 38 AreaSeries {
39 39 name: "Russian"
40 40 axisX: catergoriesAxis
41 41 upperSeries: LineSeries {
42 42 XYPoint { x: 0; y: 1 }
43 43 XYPoint { x: 1; y: 1 }
44 44 XYPoint { x: 2; y: 1 }
45 45 XYPoint { x: 3; y: 1 }
46 46 XYPoint { x: 4; y: 1 }
47 47 XYPoint { x: 5; y: 0 }
48 48 XYPoint { x: 6; y: 1 }
49 49 XYPoint { x: 7; y: 1 }
50 50 XYPoint { x: 8; y: 4 }
51 51 XYPoint { x: 9; y: 3 }
52 52 XYPoint { x: 10; y: 2 }
53 53 XYPoint { x: 11; y: 1 }
54 54 }
55 55 }
56 56 // ...
57 57 //![1]
58 58
59 59 AreaSeries {
60 60 name: "Swedish"
61 61 axisX: catergoriesAxis
62 62 upperSeries: LineSeries {
63 63 XYPoint { x: 0; y: 1 }
64 64 XYPoint { x: 1; y: 1 }
65 65 XYPoint { x: 2; y: 3 }
66 66 XYPoint { x: 3; y: 3 }
67 67 XYPoint { x: 4; y: 2 }
68 68 XYPoint { x: 5; y: 0 }
69 69 XYPoint { x: 6; y: 2 }
70 70 XYPoint { x: 7; y: 1 }
71 71 XYPoint { x: 8; y: 2 }
72 72 XYPoint { x: 9; y: 1 }
73 73 XYPoint { x: 10; y: 3 }
74 74 XYPoint { x: 11; y: 3 }
75 75 }
76 76 }
77 77
78 78 AreaSeries {
79 79 name: "Finnish"
80 80 axisX: catergoriesAxis
81 81 upperSeries: LineSeries {
82 82 XYPoint { x: 0; y: 0 }
83 83 XYPoint { x: 1; y: 0 }
84 84 XYPoint { x: 2; y: 0 }
85 85 XYPoint { x: 3; y: 0 }
86 86 XYPoint { x: 4; y: 0 }
87 87 XYPoint { x: 5; y: 0 }
88 88 XYPoint { x: 6; y: 1 }
89 89 XYPoint { x: 7; y: 0 }
90 90 XYPoint { x: 8; y: 0 }
91 91 XYPoint { x: 9; y: 0 }
92 92 XYPoint { x: 10; y: 0 }
93 93 XYPoint { x: 11; y: 1 }
94 94 }
95 95 onClicked: {
96 96 color = "white";
97 97 borderColor = "blue";
98 98 }
99 99 }
100 100 }
101 101 }
@@ -1,56 +1,56
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 Rectangle {
25 25 anchors.fill: parent
26 26
27 27 //![1]
28 28 ChartView {
29 29 title: "Scatters"
30 30 anchors.fill: parent
31 31
32 32 ScatterSeries {
33 33 id: scatter1
34 34 name: "Scatter1"
35 35 XYPoint { x: 1.5; y: 1.5 }
36 36 XYPoint { x: 1.5; y: 1.6 }
37 37 XYPoint { x: 1.57; y: 1.55 }
38 38 XYPoint { x: 1.8; y: 1.8 }
39 39 XYPoint { x: 1.9; y: 1.6 }
40 40 XYPoint { x: 2.1; y: 1.3 }
41 41 XYPoint { x: 2.5; y: 2.1 }
42 42 }
43 43
44 44 ScatterSeries {
45 45 name: "Scatter2"
46 46 // ...
47 47 //![1]
48 48 XYPoint { x: 2.0; y: 2.0 }
49 49 XYPoint { x: 2.0; y: 2.1 }
50 50 XYPoint { x: 2.07; y: 2.05 }
51 51 XYPoint { x: 2.2; y: 2.9 }
52 52 XYPoint { x: 2.4; y: 2.7 }
53 53 XYPoint { x: 2.67; y: 2.65 }
54 54 }
55 55 }
56 56 }
@@ -1,42 +1,42
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 Rectangle {
25 25 anchors.fill: parent
26 26
27 27 //![1]
28 28 ChartView {
29 29 title: "Bar series"
30 30 anchors.fill: parent
31 31 legend.alignment: Qt.AlignBottom
32 32
33 33 BarSeries {
34 34 id: mySeries
35 axisX: BarCategoriesAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] }
35 axisX: BarCategoryAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] }
36 36 BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6] }
37 37 BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] }
38 38 BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] }
39 39 }
40 40 }
41 41 //![1]
42 42 }
@@ -1,42 +1,42
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 Rectangle {
25 25 anchors.fill: parent
26 26
27 27 //![1]
28 28 ChartView {
29 29 title: "Stacked Bar series"
30 30 anchors.fill: parent
31 31 legend.alignment: Qt.AlignBottom
32 32
33 33 StackedBarSeries {
34 34 id: mySeries
35 axisX: BarCategoriesAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] }
35 axisX: BarCategoryAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] }
36 36 BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6] }
37 37 BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] }
38 38 BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] }
39 39 }
40 40 }
41 41 //![1]
42 42 }
@@ -1,41 +1,41
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 Rectangle {
25 25 anchors.fill: parent
26 26
27 27 //![1]
28 28 ChartView {
29 29 title: "Percent Bar series"
30 30 anchors.fill: parent
31 31 legend.alignment: Qt.AlignBottom
32 32
33 33 PercentBarSeries {
34 axisX: BarCategoriesAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] }
34 axisX: BarCategoryAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] }
35 35 BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6] }
36 36 BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] }
37 37 BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] }
38 38 }
39 39 }
40 40 //![1]
41 41 }
@@ -1,42 +1,42
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 Rectangle {
25 25 anchors.fill: parent
26 26
27 27 //![1]
28 28 ChartView {
29 29 title: "Horizontal Bar series"
30 30 anchors.fill: parent
31 31 legend.alignment: Qt.AlignBottom
32 32
33 33 HorizontalBarSeries {
34 axisY: BarCategoriesAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] }
34 axisY: BarCategoryAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] }
35 35 BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6] }
36 36 BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] }
37 37 BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] }
38 38 }
39 39 }
40 40 //![1]
41 41 }
42 42
@@ -1,180 +1,180
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23 import QmlCustomModel 1.0
24 24
25 25 Rectangle {
26 26 anchors.fill: parent
27 27
28 28 //![1]
29 29 ChartView {
30 30 id: chartView
31 31 title: "Top-5 car brand shares in Finland"
32 32 anchors.fill: parent
33 33 animationOptions: ChartView.SeriesAnimations
34 34
35 35 BarCategoriesAxis {
36 36 id: categoriesAxis
37 37 categories: ["2007", "2008", "2009", "2010", "2011", "2012", "2013", "2014" ]
38 38 min: "2007"
39 39 max: "2014"
40 40 }
41 41
42 42 ValueAxis {
43 43 id: valueAxis
44 44 min: 0
45 45 max: 60
46 46 }
47 47 // ...
48 48 //![1]
49 49
50 50 //![2]
51 51 CustomModel {
52 52 id: customModel
53 53 verticalHeaders: ["Manufacturer", "Volkswagen", "Toyota", "Ford", "Skoda", "Volvo", "Others"]
54 54 CustomModelElement { values: [0, "Manufacturer", 0, 1, 2, 3, 4] }
55 55 CustomModelElement { values: [1, "Volkswagen", 10.3, 12.0, 12.8, 13.0, 13.8] }
56 56 CustomModelElement { values: [2, "Toyota", 13.8, 13.5, 16.2, 13.7, 10.7] }
57 57 CustomModelElement { values: [3, "Ford", 6.4, 7.1, 8.9, 8.2, 8.6] }
58 58 CustomModelElement { values: [4, "Skoda", 4.7, 5.8, 6.9, 8.3, 8.2] }
59 59 CustomModelElement { values: [5, "Volvo", 7.1, 6.7, 6.5, 6.3, 7.0] }
60 60 CustomModelElement { values: [6, "Others", 57.7, 54.9, 48.7, 50.5, 51.7] }
61 61 }
62 62 //![2]
63 63
64 64 //![5]
65 65 BarSeries {
66 66 id: myBarSeries
67 67 name: "Others"
68 68 axisX: categoriesAxis
69 69 axisY: valueAxis
70 70 barWidth: 0.9
71 71 visible: false
72 72 HBarModelMapper {
73 73 model: customModel
74 74 firstBarSetRow: 6
75 75 lastBarSetRow: 6
76 76 firstColumn: 2
77 77 }
78 78 }
79 79 //![5]
80 80
81 81 //![4]
82 82 LineSeries {
83 83 id: lineSeries1
84 84 name: "Volkswagen"
85 85 axisX: categoriesAxis
86 86 axisY: valueAxis
87 87 visible: false
88 88 HXYModelMapper {
89 89 model: customModel
90 90 xRow: 0
91 91 yRow: 1
92 92 firstColumn: 2
93 93 }
94 94 }
95 95 //![4]
96 96
97 97 LineSeries {
98 98 id: lineSeries2
99 99 name: "Toyota"
100 100 axisX: categoriesAxis
101 101 axisY: valueAxis
102 102 visible: false
103 103 HXYModelMapper {
104 104 model: customModel
105 105 xRow: 0
106 106 yRow: 2
107 107 firstColumn: 2
108 108 }
109 109 }
110 110
111 111 LineSeries {
112 112 id: lineSeries3
113 113 name: "Ford"
114 114 axisX: categoriesAxis
115 115 axisY: valueAxis
116 116 visible: false
117 117 HXYModelMapper {
118 118 model: customModel
119 119 xRow: 0
120 120 yRow: 3
121 121 firstColumn: 2
122 122 }
123 123 }
124 124
125 125 LineSeries {
126 126 id: lineSeries4
127 127 name: "Skoda"
128 128 axisX: categoriesAxis
129 129 axisY: valueAxis
130 130 visible: false
131 131 HXYModelMapper {
132 132 model: customModel
133 133 xRow: 0
134 134 yRow: 4
135 135 firstColumn: 2
136 136 }
137 137 }
138 138
139 139 LineSeries {
140 140 id: lineSeries5
141 141 name: "Volvo"
142 142 axisX: categoriesAxis
143 143 axisY: valueAxis
144 144 visible: false
145 145 HXYModelMapper {
146 146 model: customModel
147 147 xRow: 0
148 148 yRow: 5
149 149 firstColumn: 2
150 150 }
151 151 }
152 152
153 153 //![3]
154 154 PieSeries {
155 155 id: pieSeries
156 156 size: 0.4
157 157 horizontalPosition: 0.85
158 158 verticalPosition: 0.4
159 159 onClicked: {
160 160 // Show the selection by exploding the slice
161 161 slice.exploded = !slice.exploded;
162 162
163 163 // Update the line series to show the yearly data for this slice
164 164 for (var i = 0; i < chartView.count; i++) {
165 165 if (chartView.series(i).name == slice.label) {
166 166 chartView.series(i).visible = slice.exploded;
167 167 }
168 168 }
169 169 }
170 170
171 171 VPieModelMapper {
172 172 model: customModel
173 173 labelsColumn: 1
174 174 valuesColumn: 2
175 175 firstRow: 1
176 176 }
177 177 }
178 178 //![3]
179 179 }
180 180 }
@@ -1,88 +1,88
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.1
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 Rectangle {
25 25 width: 360
26 26 height: 360
27 27 property int currentIndex: -1
28 28
29 29 //![1]
30 30 ChartView {
31 31 id: chartView
32 32 title: "Driver Speeds, lap 1"
33 33 anchors.fill: parent
34 34 legend.alignment: Qt.AlignTop
35 35 animationOptions: ChartView.SeriesAnimations
36 36 }
37 37 //![1]
38 38
39 39 //![2]
40 40 // An example XmlListModel containing F1 legend drivers' speeds at speed traps
41 41 SpeedsXml {
42 42 id: speedsXml
43 43 onStatusChanged: {
44 44 if (status == XmlListModel.Ready) {
45 45 timer.start();
46 46 }
47 47 }
48 48 }
49 49 //![2]
50 50
51 51 //![3]
52 52 // A timer to mimic refreshing the data dynamically
53 53 Timer {
54 54 id: timer
55 55 interval: 700
56 56 repeat: true
57 57 triggeredOnStart: true
58 58 running: false
59 59 onTriggered: {
60 60 currentIndex++;
61 61 if (currentIndex < speedsXml.count) {
62 62 // Check if there is a series for the data already (we are using driver name to identify series)
63 63 var lineSeries = chartView.series(speedsXml.get(currentIndex).driver);
64 64 if (!lineSeries) {
65 65 lineSeries = chartView.createSeries(ChartView.SeriesTypeLine, speedsXml.get(currentIndex).driver);
66 66 chartView.axisY().min = 0;
67 67 chartView.axisY().max = 250
68 68 }
69 69 lineSeries.append(currentIndex, speedsXml.get(currentIndex).speed);
70 70
71 71 // Make the x-axis range dynamic
72 72 if (currentIndex > 9)
73 73 chartView.axisX().min = currentIndex - 10;
74 74 else
75 75 chartView.axisX().min = 0;
76 76
77 77 chartView.axisX().max = currentIndex + 1;
78 78 } else {
79 79 // No more data, change x-axis range to show all the data
80 80 timer.stop();
81 81 chartView.animationOptions = ChartView.AllAnimations;
82 82 chartView.axisX().min = 0;
83 83 chartView.axisX().max = currentIndex + 1;
84 84 }
85 85 }
86 86 }
87 87 //![3]
88 88 }
@@ -1,103 +1,103
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 //![1]
25 25 ChartView {
26 26 id: chartView
27 27 animationOptions: ChartView.NoAnimation
28 28
29 29 ValueAxis {
30 30 id: axisY1
31 31 min: -1
32 32 max: 4
33 33 }
34 34
35 35 ValueAxis {
36 36 id: axisY2
37 37 min: -10
38 38 max: 5
39 39 }
40 40
41 41 ValueAxis {
42 42 id: axisX
43 43 min: 0
44 44 max: 1000
45 45 }
46 46
47 47 LineSeries {
48 48 id: lineSeries1
49 49 name: "signal 1"
50 50 axisX: axisX
51 51 axisY: axisY1
52 52 }
53 53 LineSeries {
54 54 id: lineSeries2
55 55 name: "signal 2"
56 56 axisX: axisX
57 57 axisY: axisY2
58 58 }
59 59 // ...
60 60 //![1]
61 61
62 62 //![2]
63 63 Timer {
64 64 id: refreshTimer
65 65 interval: 1 / 60 * 1000 // 60 Hz
66 66 running: true
67 67 repeat: true
68 68 onTriggered: {
69 69 dataSource.update(chartView.series(0));
70 70 dataSource.update(chartView.series(1));
71 71 }
72 72 }
73 73 //![2]
74 74
75 75 function changeSeriesType(type) {
76 76 chartView.series(1).destroy();
77 77 chartView.series(0).destroy();
78 78 var seriesCount = 2;
79 79 for (var i = 0; i < seriesCount; i++) {
80 80 var series;
81 81 if (type == "line") {
82 82 series = scopeView.createSeries(ChartView.SeriesTypeLine, "signal " + (i + 1));
83 83 } else if (type == "spline") {
84 84 series = chartView.createSeries(ChartView.SeriesTypeSpline, "signal " + (i + 1));
85 85 } else {
86 86 series = chartView.createSeries(ChartView.SeriesTypeScatter, "signal " + (i + 1));
87 87 series.markerSize = 3;
88 88 series.borderColor = "transparent";
89 89 }
90 90 }
91 91 }
92 92
93 93 function setAnimations(enabled) {
94 94 if (enabled)
95 95 scopeView.animationOptions = ChartView.SeriesAnimations;
96 96 else
97 97 scopeView.animationOptions = ChartView.NoAnimation;
98 98 }
99 99
100 100 function changeRefreshRate(rate) {
101 101 refreshTimer.interval = 1 / Number(rate) * 1000;
102 102 }
103 103 }
@@ -1,182 +1,182
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.1
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 Rectangle {
25 25 width: 360
26 26 height: 360
27 27
28 28 //![1]
29 29 ChartView {
30 30 id: chartView
31 31 title: "Weather forecast"
32 32 //![1]
33 33 anchors.top: parent.top
34 34 anchors.bottom: weatherImageRow.top
35 35 anchors.left: parent.left
36 36 anchors.right: parent.right
37 37 legend.alignment: Qt.AlignTop
38 38
39 39 //![2]
40 40 BarCategoriesAxis {
41 41 id: barCategoriesAxis
42 42 }
43 43
44 44 BarSeries {
45 45 id: myBarSeries
46 46 axisX: barCategoriesAxis
47 47 axisY: valueAxisY
48 48 BarSet {
49 49 id: rainfallSet
50 50 label: "Rainfall"
51 51 }
52 52 }
53 53
54 54 ValueAxis {
55 55 id: valueAxisX
56 56 min: 0
57 57 max: 5
58 58 }
59 59
60 60 ValueAxis{
61 61 id: valueAxisY
62 62 min: 0
63 63 max: 10
64 64 }
65 65
66 66 LineSeries {
67 67 id: maxTempSeries
68 68 axisX: valueAxisX
69 69 axisY: valueAxisY
70 70 name: "Max. temperature"
71 71 }
72 72
73 73 LineSeries {
74 74 id: minTempSeries
75 75 axisX: valueAxisX
76 76 axisY: valueAxisY
77 77 name: "Min. temperature"
78 78 }
79 79 //![2]
80 80 }
81 81
82 82 // A timer to refresh the forecast every 5 minutes
83 83 Timer {
84 84 interval: 300000
85 85 repeat: true
86 86 triggeredOnStart: true
87 87 running: true
88 88 onTriggered: {
89 89 if (weatherAppKey != "") {
90 90 //![3]
91 91 // Make HTTP GET request and parse the result
92 92 var xhr = new XMLHttpRequest;
93 93 xhr.open("GET",
94 94 "http://free.worldweatheronline.com/feed/weather.ashx?q=Jyv%c3%a4skyl%c3%a4,Finland&format=json&num_of_days=5&key="
95 95 + weatherAppKey);
96 96 xhr.onreadystatechange = function() {
97 97 if (xhr.readyState == XMLHttpRequest.DONE) {
98 98 var a = JSON.parse(xhr.responseText);
99 99 parseWeatherData(a);
100 100 }
101 101 }
102 102 xhr.send();
103 103 //![3]
104 104 } else {
105 105 // No app key for worldweatheronline.com given by the user -> use dummy static data
106 106 var responseText = "{ \"data\": { \"current_condition\": [ {\"cloudcover\": \"10\", \"humidity\": \"61\", \"observation_time\": \"06:26 AM\", \"precipMM\": \"0.0\", \"pressure\": \"1022\", \"temp_C\": \"6\", \"temp_F\": \"43\", \"visibility\": \"10\", \"weatherCode\": \"113\", \"weatherDesc\": [ {\"value\": \"Sunny\" } ], \"weatherIconUrl\": [ {\"value\": \"http:\/\/www.worldweatheronline.com\/images\/wsymbols01_png_64\/wsymbol_0001_sunny.png\" } ], \"winddir16Point\": \"SE\", \"winddirDegree\": \"140\", \"windspeedKmph\": \"7\", \"windspeedMiles\": \"4\" } ], \"request\": [ {\"query\": \"Jyvaskyla, Finland\", \"type\": \"City\" } ], \"weather\": [ {\"date\": \"2012-05-09\", \"precipMM\": \"0.4\", \"tempMaxC\": \"14\", \"tempMaxF\": \"57\", \"tempMinC\": \"7\", \"tempMinF\": \"45\", \"weatherCode\": \"116\", \"weatherDesc\": [ {\"value\": \"Partly Cloudy\" } ], \"weatherIconUrl\": [ {\"value\": \"http:\/\/www.worldweatheronline.com\/images\/wsymbols01_png_64\/wsymbol_0002_sunny_intervals.png\" } ], \"winddir16Point\": \"S\", \"winddirDegree\": \"179\", \"winddirection\": \"S\", \"windspeedKmph\": \"20\", \"windspeedMiles\": \"12\" }, {\"date\": \"2012-05-10\", \"precipMM\": \"2.4\", \"tempMaxC\": \"13\", \"tempMaxF\": \"55\", \"tempMinC\": \"8\", \"tempMinF\": \"46\", \"weatherCode\": \"266\", \"weatherDesc\": [ {\"value\": \"Light drizzle\" } ], \"weatherIconUrl\": [ {\"value\": \"http:\/\/www.worldweatheronline.com\/images\/wsymbols01_png_64\/wsymbol_0017_cloudy_with_light_rain.png\" } ], \"winddir16Point\": \"SW\", \"winddirDegree\": \"219\", \"winddirection\": \"SW\", \"windspeedKmph\": \"21\", \"windspeedMiles\": \"13\" }, {\"date\": \"2012-05-11\", \"precipMM\": \"11.1\", \"tempMaxC\": \"15\", \"tempMaxF\": \"59\", \"tempMinC\": \"7\", \"tempMinF\": \"44\", \"weatherCode\": \"266\", \"weatherDesc\": [ {\"value\": \"Light drizzle\" } ], \"weatherIconUrl\": [ {\"value\": \"http:\/\/www.worldweatheronline.com\/images\/wsymbols01_png_64\/wsymbol_0017_cloudy_with_light_rain.png\" } ], \"winddir16Point\": \"SSW\", \"winddirDegree\": \"200\", \"winddirection\": \"SSW\", \"windspeedKmph\": \"20\", \"windspeedMiles\": \"12\" }, {\"date\": \"2012-05-12\", \"precipMM\": \"2.8\", \"tempMaxC\": \"7\", \"tempMaxF\": \"44\", \"tempMinC\": \"2\", \"tempMinF\": \"35\", \"weatherCode\": \"317\", \"weatherDesc\": [ {\"value\": \"Light sleet\" } ], \"weatherIconUrl\": [ {\"value\": \"http:\/\/www.worldweatheronline.com\/images\/wsymbols01_png_64\/wsymbol_0021_cloudy_with_sleet.png\" } ], \"winddir16Point\": \"NW\", \"winddirDegree\": \"311\", \"winddirection\": \"NW\", \"windspeedKmph\": \"24\", \"windspeedMiles\": \"15\" }, {\"date\": \"2012-05-13\", \"precipMM\": \"0.4\", \"tempMaxC\": \"6\", \"tempMaxF\": \"42\", \"tempMinC\": \"2\", \"tempMinF\": \"35\", \"weatherCode\": \"116\", \"weatherDesc\": [ {\"value\": \"Partly Cloudy\" } ], \"weatherIconUrl\": [ {\"value\": \"http:\/\/www.worldweatheronline.com\/images\/wsymbols01_png_64\/wsymbol_0002_sunny_intervals.png\" } ], \"winddir16Point\": \"WNW\", \"winddirDegree\": \"281\", \"winddirection\": \"WNW\", \"windspeedKmph\": \"21\", \"windspeedMiles\": \"13\" } ] }}";
107 107 var a = JSON.parse(responseText);
108 108 parseWeatherData(a);
109 109 }
110 110 }
111 111 }
112 112
113 113 Row {
114 114 id: weatherImageRow
115 115 anchors.bottom: poweredByText.top
116 116 anchors.bottomMargin: 10
117 117 anchors.left: parent.left
118 118 anchors.leftMargin: 25
119 119 anchors.right: parent.right
120 120 anchors.rightMargin: 25
121 121
122 122 ListModel {
123 123 id: weatherImageModel
124 124 }
125 125
126 126 Repeater {
127 127 id: repeater
128 128 model: weatherImageModel
129 129 delegate: Image {
130 130 source: imageSource
131 131 width: weatherImageRow.width / weatherImageModel.count
132 132 height: width
133 133 fillMode: Image.PreserveAspectCrop
134 134 }
135 135 }
136 136 }
137 137
138 138 Text {
139 139 id: poweredByText
140 140 anchors.bottom: parent.bottom
141 141 anchors.bottomMargin: 10
142 142 anchors.left: parent.left
143 143 anchors.leftMargin: 25
144 144 text: "Powered by World Weather Online"
145 145 }
146 146
147 147 function parseWeatherData(weatherData) {
148 148 // Clear previous values
149 149 maxTempSeries.clear();
150 150 minTempSeries.clear();
151 151 weatherImageModel.clear();
152 152
153 153 //![4]
154 154 // Loop through the parsed JSON
155 155 for (var i in weatherData.data.weather) {
156 156 var weatherObj = weatherData.data.weather[i];
157 157 //![4]
158 158
159 159 //![5]
160 160 // Store temperature values, rainfall and weather icon
161 161 maxTempSeries.append(Number(i) + 0.5, weatherObj.tempMaxC);
162 162 minTempSeries.append(Number(i) + 0.5, weatherObj.tempMinC);
163 163 rainfallSet.append(i, weatherObj.precipMM);
164 164 weatherImageModel.append({"imageSource":weatherObj.weatherIconUrl[0].value});
165 165 //![5]
166 166
167 167 // Update scale of the chart
168 168 valueAxisY.max = Math.max(chartView.axisY().max,weatherObj.tempMaxC);
169 169 valueAxisX.min = 0;
170 170 valueAxisX.max = Number(i) + 1;
171 171
172 172 // Set the x-axis labels to the dates of the forecast
173 173 var xLabels = barCategoriesAxis.categories;
174 174 xLabels[Number(i)] = weatherObj.date.substring(5, 10);
175 175 barCategoriesAxis.categories = xLabels;
176 176 barCategoriesAxis.visible = true;
177 177 barCategoriesAxis.min = 0;
178 178 barCategoriesAxis.max = xLabels.length - 1;
179 179 }
180 180 }
181 181
182 182 }
@@ -1,53 +1,53
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 //![1]
22 22 import QtQuick 1.0
23 import QtCommercial.Chart 1.0
23 import QtCommercial.Chart 1.1
24 24
25 25 ChartView {
26 26 width: 400
27 27 height: 300
28 28 theme: ChartView.ChartThemeBrownSand
29 29
30 30 //![1]
31 31 //![2]
32 32 PieSeries {
33 33 id: pieSeries
34 34 PieSlice { label: "eaten"; value: 94.9 }
35 35 PieSlice { label: "not yet eaten"; value: 5.1 }
36 36 }
37 37 //![2]
38 38
39 39 Component.onCompleted: {
40 40 if (false) {
41 41 //![4]
42 42 pieSeries.append("don't care", 1.1);
43 43 //![4]
44 44
45 45 //![5]
46 46 pieSeries.at(0).exploded = true;
47 47 //![5]
48 48 }
49 49 }
50 50
51 51 //![3]
52 52 }
53 53 //![3]
@@ -1,59 +1,59
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 #ifndef DECLARATIVEAREASERIES_H
22 22 #define DECLARATIVEAREASERIES_H
23 23
24 24 #include "qareaseries.h"
25 25
26 26 QTCOMMERCIALCHART_BEGIN_NAMESPACE
27 27 class DeclarativeLineSeries;
28 28
29 29 class DeclarativeAreaSeries : public QAreaSeries
30 30 {
31 31 Q_OBJECT
32 32 Q_PROPERTY(DeclarativeLineSeries *upperSeries READ upperSeries WRITE setUpperSeries)
33 33 Q_PROPERTY(DeclarativeLineSeries *lowerSeries READ lowerSeries WRITE setLowerSeries)
34 Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged)
35 Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged)
34 Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1)
35 Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1)
36 36
37 37 public:
38 38 explicit DeclarativeAreaSeries(QObject *parent = 0);
39 39 void setUpperSeries(DeclarativeLineSeries* series);
40 40 DeclarativeLineSeries* upperSeries() const;
41 41 void setLowerSeries(DeclarativeLineSeries* series);
42 42 DeclarativeLineSeries* lowerSeries() const;
43 43 QAbstractAxis *axisX() { return m_axisX; }
44 44 void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); }
45 45 QAbstractAxis *axisY() { return m_axisY; }
46 46 void setAxisY(QAbstractAxis *axis) { m_axisY = axis; emit axisYChanged(axis); }
47 47
48 48 Q_SIGNALS:
49 void axisXChanged(QAbstractAxis *axis);
50 void axisYChanged(QAbstractAxis *axis);
49 Q_REVISION(1) void axisXChanged(QAbstractAxis *axis);
50 Q_REVISION(1) void axisYChanged(QAbstractAxis *axis);
51 51
52 52 private:
53 53 QAbstractAxis *m_axisX;
54 54 QAbstractAxis *m_axisY;
55 55 };
56 56
57 57 QTCOMMERCIALCHART_END_NAMESPACE
58 58
59 59 #endif // DECLARATIVEAREASERIES_H
@@ -1,304 +1,304
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 #ifndef DECLARATIVEBARSERIES_H
22 22 #define DECLARATIVEBARSERIES_H
23 23
24 24 #include "qbarseries.h"
25 25 #include "qstackedbarseries.h"
26 26 #include "qpercentbarseries.h"
27 27 #include "qhorizontalbarseries.h"
28 28 #include "qhorizontalstackedbarseries.h"
29 29 #include "qhorizontalpercentbarseries.h"
30 30 #include "qbarset.h"
31 31 #include <QDeclarativeItem>
32 32 #include <QDeclarativeParserStatus>
33 33
34 34 QTCOMMERCIALCHART_BEGIN_NAMESPACE
35 35
36 36 class QChart;
37 37
38 38 class DeclarativeBarSet : public QBarSet
39 39 {
40 40 Q_OBJECT
41 41 Q_PROPERTY(QVariantList values READ values WRITE setValues)
42 42 Q_PROPERTY(int count READ count NOTIFY countChanged)
43 43
44 44 public:
45 45 explicit DeclarativeBarSet(QObject *parent = 0);
46 46 QVariantList values();
47 47 void setValues(QVariantList values);
48 48
49 49 public: // From QBarSet
50 50 Q_INVOKABLE void append(qreal value) { QBarSet::append(value); }
51 51 Q_INVOKABLE void remove(const int index, const int count = 1) { QBarSet::remove(index, count); }
52 52 Q_INVOKABLE void replace(int index, qreal value) { QBarSet::replace(index, value); }
53 53 Q_INVOKABLE qreal at(int index) { return QBarSet::at(index); }
54 54
55 55 Q_SIGNALS:
56 56 void countChanged(int count);
57 57
58 58 private Q_SLOTS:
59 59 void handleCountChanged(int index, int count);
60 60 };
61 61
62 62 class DeclarativeBarSeries : public QBarSeries, public QDeclarativeParserStatus
63 63 {
64 64 Q_OBJECT
65 65 Q_INTERFACES(QDeclarativeParserStatus)
66 Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged)
67 Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged)
66 Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1)
67 Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1)
68 68 Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren)
69 69 Q_CLASSINFO("DefaultProperty", "seriesChildren")
70 70
71 71 public:
72 72 explicit DeclarativeBarSeries(QDeclarativeItem *parent = 0);
73 73 QAbstractAxis *axisX() { return m_axisX; }
74 74 void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); }
75 75 QAbstractAxis *axisY() { return m_axisY; }
76 76 void setAxisY(QAbstractAxis *axis) { m_axisY = axis; emit axisYChanged(axis); }
77 77 QDeclarativeListProperty<QObject> seriesChildren();
78 78
79 79 public:
80 80 Q_INVOKABLE DeclarativeBarSet *at(int index);
81 81 Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); }
82 82 Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values);
83 83 Q_INVOKABLE bool remove(QBarSet *barset) { return QBarSeries::remove(barset); }
84 84 Q_INVOKABLE void clear() { return QBarSeries::clear(); }
85 85
86 86 public: // from QDeclarativeParserStatus
87 87 void classBegin();
88 88 void componentComplete();
89 89
90 90 Q_SIGNALS:
91 void axisXChanged(QAbstractAxis *axis);
92 void axisYChanged(QAbstractAxis *axis);
91 Q_REVISION(1) void axisXChanged(QAbstractAxis *axis);
92 Q_REVISION(1) void axisYChanged(QAbstractAxis *axis);
93 93
94 94 public Q_SLOTS:
95 95 static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element);
96 96
97 97 private:
98 98 QAbstractAxis* m_axisX;
99 99 QAbstractAxis* m_axisY;
100 100 };
101 101
102 102 class DeclarativeStackedBarSeries : public QStackedBarSeries, public QDeclarativeParserStatus
103 103 {
104 104 Q_OBJECT
105 105 Q_INTERFACES(QDeclarativeParserStatus)
106 Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged)
107 Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged)
106 Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1)
107 Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1)
108 108 Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren)
109 109 Q_CLASSINFO("DefaultProperty", "seriesChildren")
110 110
111 111 public:
112 112 explicit DeclarativeStackedBarSeries(QDeclarativeItem *parent = 0);
113 113 QAbstractAxis *axisX() { return m_axisX; }
114 114 void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); }
115 115 QAbstractAxis *axisY() { return m_axisY; }
116 116 void setAxisY(QAbstractAxis *axis) { m_axisY = axis; emit axisYChanged(axis); }
117 117 QDeclarativeListProperty<QObject> seriesChildren();
118 118
119 119 public:
120 120 Q_INVOKABLE DeclarativeBarSet *at(int index);
121 121 Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); }
122 122 Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values);
123 123 Q_INVOKABLE bool remove(QBarSet *barset) { return QStackedBarSeries::remove(barset); }
124 124 Q_INVOKABLE void clear() { return QStackedBarSeries::clear(); }
125 125
126 126 public: // from QDeclarativeParserStatus
127 127 void classBegin();
128 128 void componentComplete();
129 129
130 130 Q_SIGNALS:
131 void axisXChanged(QAbstractAxis *axis);
132 void axisYChanged(QAbstractAxis *axis);
131 Q_REVISION(1) void axisXChanged(QAbstractAxis *axis);
132 Q_REVISION(1) void axisYChanged(QAbstractAxis *axis);
133 133
134 134 public Q_SLOTS:
135 135 static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element);
136 136
137 137 private:
138 138 QAbstractAxis* m_axisX;
139 139 QAbstractAxis* m_axisY;
140 140 };
141 141
142 142 class DeclarativePercentBarSeries : public QPercentBarSeries, public QDeclarativeParserStatus
143 143 {
144 144 Q_OBJECT
145 145 Q_INTERFACES(QDeclarativeParserStatus)
146 Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged)
147 Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged)
146 Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1)
147 Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1)
148 148 Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren)
149 149 Q_CLASSINFO("DefaultProperty", "seriesChildren")
150 150
151 151 public:
152 152 explicit DeclarativePercentBarSeries(QDeclarativeItem *parent = 0);
153 153 QAbstractAxis *axisX() { return m_axisX; }
154 154 void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); }
155 155 QAbstractAxis *axisY() { return m_axisY; }
156 156 void setAxisY(QAbstractAxis *axis) { m_axisY = axis; emit axisYChanged(axis); }
157 157 QDeclarativeListProperty<QObject> seriesChildren();
158 158
159 159 public:
160 160 Q_INVOKABLE DeclarativeBarSet *at(int index);
161 161 Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); }
162 162 Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values);
163 163 Q_INVOKABLE bool remove(QBarSet *barset) { return QPercentBarSeries::remove(barset); }
164 164 Q_INVOKABLE void clear() { return QPercentBarSeries::clear(); }
165 165
166 166 public: // from QDeclarativeParserStatus
167 167 void classBegin();
168 168 void componentComplete();
169 169
170 170 Q_SIGNALS:
171 void axisXChanged(QAbstractAxis *axis);
172 void axisYChanged(QAbstractAxis *axis);
171 Q_REVISION(1) void axisXChanged(QAbstractAxis *axis);
172 Q_REVISION(1) void axisYChanged(QAbstractAxis *axis);
173 173
174 174 public Q_SLOTS:
175 175 static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element);
176 176
177 177 private:
178 178 QAbstractAxis* m_axisX;
179 179 QAbstractAxis* m_axisY;
180 180 };
181 181
182 182 class DeclarativeHorizontalBarSeries : public QHorizontalBarSeries, public QDeclarativeParserStatus
183 183 {
184 184 Q_OBJECT
185 185 Q_INTERFACES(QDeclarativeParserStatus)
186 Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged)
187 Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged)
186 Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1)
187 Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1)
188 188 Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren)
189 189 Q_CLASSINFO("DefaultProperty", "seriesChildren")
190 190
191 191 public:
192 192 explicit DeclarativeHorizontalBarSeries(QDeclarativeItem *parent = 0);
193 193 QAbstractAxis *axisX() { return m_axisX; }
194 194 void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); }
195 195 QAbstractAxis *axisY() { return m_axisY; }
196 196 void setAxisY(QAbstractAxis *axis) { m_axisY = axis; emit axisYChanged(axis); }
197 197 QDeclarativeListProperty<QObject> seriesChildren();
198 198
199 199 public:
200 200 Q_INVOKABLE DeclarativeBarSet *at(int index);
201 201 Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); }
202 202 Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values);
203 203 Q_INVOKABLE bool remove(QBarSet *barset) { return QHorizontalBarSeries::remove(barset); }
204 204 Q_INVOKABLE void clear() { return QHorizontalBarSeries::clear(); }
205 205
206 206 public: // from QDeclarativeParserStatus
207 207 void classBegin();
208 208 void componentComplete();
209 209
210 210 Q_SIGNALS:
211 void axisXChanged(QAbstractAxis *axis);
212 void axisYChanged(QAbstractAxis *axis);
211 Q_REVISION(1) void axisXChanged(QAbstractAxis *axis);
212 Q_REVISION(1) void axisYChanged(QAbstractAxis *axis);
213 213
214 214 public Q_SLOTS:
215 215 static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element);
216 216
217 217 private:
218 218 QAbstractAxis* m_axisX;
219 219 QAbstractAxis* m_axisY;
220 220 };
221 221
222 222 class DeclarativeHorizontalStackedBarSeries : public QHorizontalStackedBarSeries, public QDeclarativeParserStatus
223 223 {
224 224 Q_OBJECT
225 225 Q_INTERFACES(QDeclarativeParserStatus)
226 Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged)
227 Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged)
226 Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1)
227 Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1)
228 228 Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren)
229 229 Q_CLASSINFO("DefaultProperty", "seriesChildren")
230 230
231 231 public:
232 232 explicit DeclarativeHorizontalStackedBarSeries(QDeclarativeItem *parent = 0);
233 233 QAbstractAxis *axisX() { return m_axisX; }
234 234 void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); }
235 235 QAbstractAxis *axisY() { return m_axisY; }
236 236 void setAxisY(QAbstractAxis *axis) { m_axisY = axis; emit axisYChanged(axis); }
237 237 QDeclarativeListProperty<QObject> seriesChildren();
238 238
239 239 public:
240 240 Q_INVOKABLE DeclarativeBarSet *at(int index);
241 241 Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); }
242 242 Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values);
243 243 Q_INVOKABLE bool remove(QBarSet *barset) { return QHorizontalStackedBarSeries::remove(barset); }
244 244 Q_INVOKABLE void clear() { return QHorizontalStackedBarSeries::clear(); }
245 245
246 246 public: // from QDeclarativeParserStatus
247 247 void classBegin();
248 248 void componentComplete();
249 249
250 250 Q_SIGNALS:
251 void axisXChanged(QAbstractAxis *axis);
252 void axisYChanged(QAbstractAxis *axis);
251 Q_REVISION(1) void axisXChanged(QAbstractAxis *axis);
252 Q_REVISION(1) void axisYChanged(QAbstractAxis *axis);
253 253
254 254 public Q_SLOTS:
255 255 static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element);
256 256
257 257 private:
258 258 QAbstractAxis* m_axisX;
259 259 QAbstractAxis* m_axisY;
260 260 };
261 261
262 262 class DeclarativeHorizontalPercentBarSeries : public QHorizontalPercentBarSeries, public QDeclarativeParserStatus
263 263 {
264 264 Q_OBJECT
265 265 Q_INTERFACES(QDeclarativeParserStatus)
266 Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged)
267 Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged)
266 Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1)
267 Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1)
268 268 Q_PROPERTY(QDeclarativeListProperty<QObject> seriesChildren READ seriesChildren)
269 269 Q_CLASSINFO("DefaultProperty", "seriesChildren")
270 270
271 271 public:
272 272 explicit DeclarativeHorizontalPercentBarSeries(QDeclarativeItem *parent = 0);
273 273 QAbstractAxis *axisX() { return m_axisX; }
274 274 void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); }
275 275 QAbstractAxis *axisY() { return m_axisY; }
276 276 void setAxisY(QAbstractAxis *axis) { m_axisY = axis; emit axisYChanged(axis); }
277 277 QDeclarativeListProperty<QObject> seriesChildren();
278 278
279 279 public:
280 280 Q_INVOKABLE DeclarativeBarSet *at(int index);
281 281 Q_INVOKABLE DeclarativeBarSet *append(QString label, QVariantList values) { return insert(count(), label, values); }
282 282 Q_INVOKABLE DeclarativeBarSet *insert(int index, QString label, QVariantList values);
283 283 Q_INVOKABLE bool remove(QBarSet *barset) { return QHorizontalPercentBarSeries::remove(barset); }
284 284 Q_INVOKABLE void clear() { return QHorizontalPercentBarSeries::clear(); }
285 285
286 286 public: // from QDeclarativeParserStatus
287 287 void classBegin();
288 288 void componentComplete();
289 289
290 290 Q_SIGNALS:
291 void axisXChanged(QAbstractAxis *axis);
292 void axisYChanged(QAbstractAxis *axis);
291 Q_REVISION(1) void axisXChanged(QAbstractAxis *axis);
292 Q_REVISION(1) void axisYChanged(QAbstractAxis *axis);
293 293
294 294 public Q_SLOTS:
295 295 static void appendSeriesChildren(QDeclarativeListProperty<QObject> *list, QObject *element);
296 296
297 297 private:
298 298 QAbstractAxis* m_axisX;
299 299 QAbstractAxis* m_axisY;
300 300 };
301 301
302 302 QTCOMMERCIALCHART_END_NAMESPACE
303 303
304 304 #endif // DECLARATIVEBARSERIES_H
@@ -1,78 +1,78
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 #ifndef DECLARATIVELINESERIES_H
22 22 #define DECLARATIVELINESERIES_H
23 23
24 24 #include "qlineseries.h"
25 25 #include "declarativexyseries.h"
26 26 #include <QDeclarativeListProperty>
27 27 #include <QDeclarativeParserStatus>
28 28
29 29 QTCOMMERCIALCHART_BEGIN_NAMESPACE
30 30
31 31 class DeclarativeLineSeries : public QLineSeries, public DeclarativeXySeries, public QDeclarativeParserStatus
32 32 {
33 33 Q_OBJECT
34 34 Q_INTERFACES(QDeclarativeParserStatus)
35 35 Q_PROPERTY(int count READ count NOTIFY countChanged)
36 Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged)
37 Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged)
36 Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1)
37 Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1)
38 38 Q_PROPERTY(QDeclarativeListProperty<QObject> declarativeChildren READ declarativeChildren)
39 39 Q_CLASSINFO("DefaultProperty", "declarativeChildren")
40 40
41 41 public:
42 42 explicit DeclarativeLineSeries(QObject *parent = 0);
43 43 QXYSeries *xySeries() { return this; }
44 44 QAbstractAxis *axisX() { return m_axisX; }
45 45 void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); }
46 46 QAbstractAxis *axisY() { return m_axisY; }
47 47 void setAxisY(QAbstractAxis *axis) { m_axisY = axis; emit axisYChanged(axis); }
48 48 QDeclarativeListProperty<QObject> declarativeChildren();
49 49
50 50 public: // from QDeclarativeParserStatus
51 51 void classBegin() { DeclarativeXySeries::classBegin(); }
52 52 void componentComplete() { DeclarativeXySeries::componentComplete(); }
53 53
54 54 public:
55 55 Q_INVOKABLE void append(qreal x, qreal y) { DeclarativeXySeries::append(x, y); }
56 56 Q_INVOKABLE void replace(qreal oldX, qreal oldY, qreal newX, qreal newY) { DeclarativeXySeries::replace(oldX, oldY, newX, newY); }
57 57 Q_INVOKABLE void remove(qreal x, qreal y) { DeclarativeXySeries::remove(x, y); }
58 58 Q_INVOKABLE void insert(int index, qreal x, qreal y) { DeclarativeXySeries::insert(index, x, y); }
59 59 Q_INVOKABLE void clear() { DeclarativeXySeries::clear(); }
60 60 Q_INVOKABLE QPointF at(int index) { return DeclarativeXySeries::at(index); }
61 61
62 62 Q_SIGNALS:
63 63 void countChanged(int count);
64 void axisXChanged(QAbstractAxis *axis);
65 void axisYChanged(QAbstractAxis *axis);
64 Q_REVISION(1) void axisXChanged(QAbstractAxis *axis);
65 Q_REVISION(1) void axisYChanged(QAbstractAxis *axis);
66 66
67 67 public Q_SLOTS:
68 68 static void appendDeclarativeChildren(QDeclarativeListProperty<QObject> *list, QObject *element);
69 69 void handleCountChanged(int index);
70 70
71 71 private:
72 72 QAbstractAxis *m_axisX;
73 73 QAbstractAxis *m_axisY;
74 74 };
75 75
76 76 QTCOMMERCIALCHART_END_NAMESPACE
77 77
78 78 #endif // DECLARATIVELINESERIES_H
@@ -1,78 +1,78
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 #ifndef DECLARATIVESCATTERSERIES_H
22 22 #define DECLARATIVESCATTERSERIES_H
23 23
24 24 #include "qscatterseries.h"
25 25 #include "declarativexyseries.h"
26 26 #include <QDeclarativeListProperty>
27 27 #include <QDeclarativeParserStatus>
28 28
29 29 QTCOMMERCIALCHART_BEGIN_NAMESPACE
30 30
31 31 class DeclarativeScatterSeries : public QScatterSeries, public DeclarativeXySeries, public QDeclarativeParserStatus
32 32 {
33 33 Q_OBJECT
34 34 Q_INTERFACES(QDeclarativeParserStatus)
35 35 Q_PROPERTY(int count READ count NOTIFY countChanged)
36 Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged)
37 Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged)
36 Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1)
37 Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1)
38 38 Q_PROPERTY(QDeclarativeListProperty<QObject> declarativeChildren READ declarativeChildren)
39 39 Q_CLASSINFO("DefaultProperty", "declarativeChildren")
40 40
41 41 public:
42 42 explicit DeclarativeScatterSeries(QObject *parent = 0);
43 43 QXYSeries *xySeries() { return this; }
44 44 QAbstractAxis *axisX() { return m_axisX; }
45 45 void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); }
46 46 QAbstractAxis *axisY() { return m_axisY; }
47 47 void setAxisY(QAbstractAxis *axis) { m_axisY = axis; emit axisYChanged(axis); }
48 48 QDeclarativeListProperty<QObject> declarativeChildren();
49 49
50 50 public: // from QDeclarativeParserStatus
51 51 void classBegin() { DeclarativeXySeries::classBegin(); }
52 52 void componentComplete() { DeclarativeXySeries::componentComplete(); }
53 53
54 54 public:
55 55 Q_INVOKABLE void append(qreal x, qreal y) { DeclarativeXySeries::append(x, y); }
56 56 Q_INVOKABLE void replace(qreal oldX, qreal oldY, qreal newX, qreal newY) { DeclarativeXySeries::replace(oldX, oldY, newX, newY); }
57 57 Q_INVOKABLE void remove(qreal x, qreal y) { DeclarativeXySeries::remove(x, y); }
58 58 Q_INVOKABLE void insert(int index, qreal x, qreal y) { DeclarativeXySeries::insert(index, x, y); }
59 59 Q_INVOKABLE void clear() { DeclarativeXySeries::clear(); }
60 60 Q_INVOKABLE QPointF at(int index) { return DeclarativeXySeries::at(index); }
61 61
62 62 Q_SIGNALS:
63 63 void countChanged(int count);
64 void axisXChanged(QAbstractAxis *axis);
65 void axisYChanged(QAbstractAxis *axis);
64 Q_REVISION(1) void axisXChanged(QAbstractAxis *axis);
65 Q_REVISION(1) void axisYChanged(QAbstractAxis *axis);
66 66
67 67 public Q_SLOTS:
68 68 static void appendDeclarativeChildren(QDeclarativeListProperty<QObject> *list, QObject *element);
69 69 void handleCountChanged(int index);
70 70
71 71 private:
72 72 QAbstractAxis *m_axisX;
73 73 QAbstractAxis *m_axisY;
74 74 };
75 75
76 76 QTCOMMERCIALCHART_END_NAMESPACE
77 77
78 78 #endif // DECLARATIVESCATTERSERIES_H
@@ -1,78 +1,78
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 #ifndef DECLARATIVESPLINESERIES_H
22 22 #define DECLARATIVESPLINESERIES_H
23 23
24 24 #include "qsplineseries.h"
25 25 #include "declarativexyseries.h"
26 26 #include <QDeclarativeParserStatus>
27 27 #include <QDeclarativeListProperty>
28 28
29 29 QTCOMMERCIALCHART_BEGIN_NAMESPACE
30 30
31 31 class DeclarativeSplineSeries : public QSplineSeries, public DeclarativeXySeries, public QDeclarativeParserStatus
32 32 {
33 33 Q_OBJECT
34 34 Q_INTERFACES(QDeclarativeParserStatus)
35 35 Q_PROPERTY(int count READ count NOTIFY countChanged)
36 Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged)
37 Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged)
36 Q_PROPERTY(QAbstractAxis *axisX READ axisX WRITE setAxisX NOTIFY axisXChanged REVISION 1)
37 Q_PROPERTY(QAbstractAxis *axisY READ axisY WRITE setAxisY NOTIFY axisYChanged REVISION 1)
38 38 Q_PROPERTY(QDeclarativeListProperty<QObject> declarativeChildren READ declarativeChildren)
39 39 Q_CLASSINFO("DefaultProperty", "declarativeChildren")
40 40
41 41 public:
42 42 explicit DeclarativeSplineSeries(QObject *parent = 0);
43 43 QXYSeries *xySeries() { return this; }
44 44 QAbstractAxis *axisX() { return m_axisX; }
45 45 void setAxisX(QAbstractAxis *axis) { m_axisX = axis; emit axisXChanged(axis); }
46 46 QAbstractAxis *axisY() { return m_axisY; }
47 47 void setAxisY(QAbstractAxis *axis) { m_axisY = axis; emit axisYChanged(axis); }
48 48 QDeclarativeListProperty<QObject> declarativeChildren();
49 49
50 50 public: // from QDeclarativeParserStatus
51 51 void classBegin() { DeclarativeXySeries::classBegin(); }
52 52 void componentComplete() { DeclarativeXySeries::componentComplete(); }
53 53
54 54 public:
55 55 Q_INVOKABLE void append(qreal x, qreal y) { DeclarativeXySeries::append(x, y); }
56 56 Q_INVOKABLE void replace(qreal oldX, qreal oldY, qreal newX, qreal newY) { DeclarativeXySeries::replace(oldX, oldY, newX, newY); }
57 57 Q_INVOKABLE void remove(qreal x, qreal y) { DeclarativeXySeries::remove(x, y); }
58 58 Q_INVOKABLE void insert(int index, qreal x, qreal y) { DeclarativeXySeries::insert(index, x, y); }
59 59 Q_INVOKABLE void clear() { DeclarativeXySeries::clear(); }
60 60 Q_INVOKABLE QPointF at(int index) { return DeclarativeXySeries::at(index); }
61 61
62 62 Q_SIGNALS:
63 63 void countChanged(int count);
64 void axisXChanged(QAbstractAxis *axis);
65 void axisYChanged(QAbstractAxis *axis);
64 Q_REVISION(1) void axisXChanged(QAbstractAxis *axis);
65 Q_REVISION(1) void axisYChanged(QAbstractAxis *axis);
66 66
67 67 public Q_SLOTS:
68 68 static void appendDeclarativeChildren(QDeclarativeListProperty<QObject> *list, QObject *element);
69 69 void handleCountChanged(int index);
70 70
71 71 public:
72 72 QAbstractAxis *m_axisX;
73 73 QAbstractAxis *m_axisY;
74 74 };
75 75
76 76 QTCOMMERCIALCHART_END_NAMESPACE
77 77
78 78 #endif // DECLARATIVESPLINESERIES_H
@@ -1,104 +1,144
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 #include <QtDeclarative/qdeclarativeextensionplugin.h>
22 22 #include <QtDeclarative/qdeclarative.h>
23 23 #include "qchart.h"
24 24 #include "qabstractaxis.h"
25 25 #include "qvalueaxis.h"
26 26 #include "qbarcategoryaxis.h"
27 27 #include "declarativechart.h"
28 28 #include "declarativexypoint.h"
29 29 #include "declarativelineseries.h"
30 30 #include "declarativesplineseries.h"
31 31 #include "declarativeareaseries.h"
32 32 #include "declarativescatterseries.h"
33 33 #include "declarativebarseries.h"
34 34 #include "declarativepieseries.h"
35 35 #include "qvxymodelmapper.h"
36 36 #include "qhxymodelmapper.h"
37 37 #include "qhpiemodelmapper.h"
38 38 #include "qvpiemodelmapper.h"
39 39 #include "qhbarmodelmapper.h"
40 40 #include "qvbarmodelmapper.h"
41 41 #include <QAbstractItemModel>
42 42
43 43 QTCOMMERCIALCHART_BEGIN_NAMESPACE
44 44
45 45 class ChartQmlPlugin : public QDeclarativeExtensionPlugin
46 46 {
47 47 Q_OBJECT
48 48 public:
49 49 virtual void registerTypes(const char *uri)
50 50 {
51 51 Q_ASSERT(QLatin1String(uri) == QLatin1String("QtCommercial.Chart"));
52 52
53 // QtCommercial.Chart 1.0
53 54 qmlRegisterType<DeclarativeChart>(uri, 1, 0, "ChartView");
54 55 qmlRegisterType<DeclarativeXYPoint>(uri, 1, 0, "XYPoint");
55 56 qmlRegisterType<DeclarativeScatterSeries>(uri, 1, 0, "ScatterSeries");
56 57 qmlRegisterType<DeclarativeLineSeries>(uri, 1, 0, "LineSeries");
57 58 qmlRegisterType<DeclarativeSplineSeries>(uri, 1, 0, "SplineSeries");
58 59 qmlRegisterType<DeclarativeAreaSeries>(uri, 1, 0, "AreaSeries");
59 60 qmlRegisterType<DeclarativeBarSeries>(uri, 1, 0, "BarSeries");
60 61 qmlRegisterType<DeclarativeStackedBarSeries>(uri, 1, 0, "StackedBarSeries");
61 62 qmlRegisterType<DeclarativePercentBarSeries>(uri, 1, 0, "PercentBarSeries");
62 qmlRegisterType<DeclarativeHorizontalBarSeries>(uri, 1, 0, "HorizontalBarSeries");
63 qmlRegisterType<DeclarativeHorizontalStackedBarSeries>(uri, 1, 0, "HorizontalStackedBarSeries");
64 qmlRegisterType<DeclarativeHorizontalPercentBarSeries>(uri, 1, 0, "HorizontalPercentBarSeries");
65 63 qmlRegisterType<DeclarativePieSeries>(uri, 1, 0, "PieSeries");
66 64 qmlRegisterType<QPieSlice>(uri, 1, 0, "PieSlice");
67 65 qmlRegisterType<DeclarativeBarSet>(uri, 1, 0, "BarSet");
68 66 qmlRegisterType<QHXYModelMapper>(uri, 1, 0, "HXYModelMapper");
69 67 qmlRegisterType<QVXYModelMapper>(uri, 1, 0, "VXYModelMapper");
70 68 qmlRegisterType<QHPieModelMapper>(uri, 1, 0, "HPieModelMapper");
71 69 qmlRegisterType<QVPieModelMapper>(uri, 1, 0, "VPieModelMapper");
72 70 qmlRegisterType<QHBarModelMapper>(uri, 1, 0, "HBarModelMapper");
73 71 qmlRegisterType<QVBarModelMapper>(uri, 1, 0, "VBarModelMapper");
74 qmlRegisterType<QValueAxis>(uri, 1, 0, "ValueAxis");
72 qmlRegisterType<QValueAxis>(uri, 1, 0, "ValuesAxis");
75 73 qmlRegisterType<QBarCategoryAxis>(uri, 1, 0, "BarCategoriesAxis");
76
77 74 qmlRegisterUncreatableType<QLegend>(uri, 1, 0, "Legend",
78 75 QLatin1String("Trying to create uncreatable: Legend."));
79 76 qmlRegisterUncreatableType<QXYSeries>(uri, 1, 0, "XYSeries",
80 77 QLatin1String("Trying to create uncreatable: XYSeries."));
81 78 qmlRegisterUncreatableType<QAbstractItemModel>(uri, 1, 0, "AbstractItemModel",
82 79 QLatin1String("Trying to create uncreatable: AbstractItemModel."));
83 80 qmlRegisterUncreatableType<QXYModelMapper>(uri, 1, 0, "XYModelMapper",
84 81 QLatin1String("Trying to create uncreatable: XYModelMapper."));
85 82 qmlRegisterUncreatableType<QPieModelMapper>(uri, 1, 0, "PieModelMapper",
86 83 QLatin1String("Trying to create uncreatable: PieModelMapper."));
87 84 qmlRegisterUncreatableType<QBarModelMapper>(uri, 1, 0, "BarModelMapper",
88 85 QLatin1String("Trying to create uncreatable: BarModelMapper."));
89 86 qmlRegisterUncreatableType<QAbstractSeries>(uri, 1, 0, "AbstractSeries",
90 87 QLatin1String("Trying to create uncreatable: AbstractSeries."));
91 88 qmlRegisterUncreatableType<QAbstractBarSeries>(uri, 1, 0, "AbstractBarSeries",
92 89 QLatin1String("Trying to create uncreatable: AbstractBarSeries."));
93 90 qmlRegisterUncreatableType<QAbstractAxis>(uri, 1, 0, "AbstractAxis",
94 91 QLatin1String("Trying to create uncreatable: AbstractAxis. Use specific types of axis instead."));
92
93 // QtCommercial.Chart 1.1
94 qmlRegisterType<DeclarativeChart>(uri, 1, 1, "ChartView");
95 qmlRegisterType<DeclarativeXYPoint>(uri, 1, 1, "XYPoint");
96 qmlRegisterType<DeclarativeScatterSeries, 1>(uri, 1, 1, "ScatterSeries");
97 qmlRegisterType<DeclarativeLineSeries, 1>(uri, 1, 1, "LineSeries");
98 qmlRegisterType<DeclarativeSplineSeries, 1>(uri, 1, 1, "SplineSeries");
99 qmlRegisterType<DeclarativeAreaSeries, 1>(uri, 1, 1, "AreaSeries");
100 qmlRegisterType<DeclarativeBarSeries, 1>(uri, 1, 1, "BarSeries");
101 qmlRegisterType<DeclarativeStackedBarSeries, 1>(uri, 1, 1, "StackedBarSeries");
102 qmlRegisterType<DeclarativePercentBarSeries, 1>(uri, 1, 1, "PercentBarSeries");
103 qmlRegisterType<DeclarativeHorizontalBarSeries, 1>(uri, 1, 1, "HorizontalBarSeries");
104 qmlRegisterType<DeclarativeHorizontalStackedBarSeries, 1>(uri, 1, 1, "HorizontalStackedBarSeries");
105 qmlRegisterType<DeclarativeHorizontalPercentBarSeries, 1>(uri, 1, 1, "HorizontalPercentBarSeries");
106 qmlRegisterType<DeclarativePieSeries>(uri, 1, 1, "PieSeries");
107 qmlRegisterType<QPieSlice>(uri, 1, 1, "PieSlice");
108 qmlRegisterType<DeclarativeBarSet>(uri, 1, 1, "BarSet");
109 qmlRegisterType<QHXYModelMapper>(uri, 1, 1, "HXYModelMapper");
110 qmlRegisterType<QVXYModelMapper>(uri, 1, 1, "VXYModelMapper");
111 qmlRegisterType<QHPieModelMapper>(uri, 1, 1, "HPieModelMapper");
112 qmlRegisterType<QVPieModelMapper>(uri, 1, 1, "VPieModelMapper");
113 qmlRegisterType<QHBarModelMapper>(uri, 1, 1, "HBarModelMapper");
114 qmlRegisterType<QVBarModelMapper>(uri, 1, 1, "VBarModelMapper");
115 qmlRegisterType<QValueAxis>(uri, 1, 1, "ValueAxis");
116 qmlRegisterType<QBarCategoryAxis>(uri, 1, 1, "BarCategoryAxis");
117 qmlRegisterUncreatableType<QLegend>(uri, 1, 1, "Legend",
118 QLatin1String("Trying to create uncreatable: Legend."));
119 qmlRegisterUncreatableType<QXYSeries>(uri, 1, 1, "XYSeries",
120 QLatin1String("Trying to create uncreatable: XYSeries."));
121 qmlRegisterUncreatableType<QAbstractItemModel>(uri, 1, 1, "AbstractItemModel",
122 QLatin1String("Trying to create uncreatable: AbstractItemModel."));
123 qmlRegisterUncreatableType<QXYModelMapper>(uri, 1, 1, "XYModelMapper",
124 QLatin1String("Trying to create uncreatable: XYModelMapper."));
125 qmlRegisterUncreatableType<QPieModelMapper>(uri, 1, 1, "PieModelMapper",
126 QLatin1String("Trying to create uncreatable: PieModelMapper."));
127 qmlRegisterUncreatableType<QBarModelMapper>(uri, 1, 1, "BarModelMapper",
128 QLatin1String("Trying to create uncreatable: BarModelMapper."));
129 qmlRegisterUncreatableType<QAbstractSeries>(uri, 1, 1, "AbstractSeries",
130 QLatin1String("Trying to create uncreatable: AbstractSeries."));
131 qmlRegisterUncreatableType<QAbstractBarSeries>(uri, 1, 1, "AbstractBarSeries",
132 QLatin1String("Trying to create uncreatable: AbstractBarSeries."));
133 qmlRegisterUncreatableType<QAbstractAxis>(uri, 1, 1, "AbstractAxis",
134 QLatin1String("Trying to create uncreatable: AbstractAxis. Use specific types of axis instead."));
95 135 }
96 136 };
97 137
98 138 #include "plugin.moc"
99 139
100 140 QTCOMMERCIALCHART_END_NAMESPACE
101 141
102 142 QTCOMMERCIALCHART_USE_NAMESPACE
103 143
104 144 Q_EXPORT_PLUGIN2(qtcommercialchartqml, QT_PREPEND_NAMESPACE(ChartQmlPlugin))
@@ -1,49 +1,49
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 ChartView {
25 25 id: chartView
26 26 title: "default axes"
27 27
28 28 LineSeries {
29 29 name: "line series"
30 30 XYPoint { x: 0; y: 0 }
31 31 XYPoint { x: 1.1; y: 2.1 }
32 32 XYPoint { x: 1.9; y: 3.3 }
33 33 XYPoint { x: 2.1; y: 2.1 }
34 34 XYPoint { x: 2.9; y: 4.9 }
35 35 XYPoint { x: 3.4; y: 3.0 }
36 36 XYPoint { x: 4.1; y: 3.3 }
37 37 }
38 38
39 39 ScatterSeries {
40 40 name: "scatter series"
41 41 XYPoint { x: 0; y: 0 }
42 42 XYPoint { x: 1.1; y: 2.1 }
43 43 XYPoint { x: 1.9; y: 3.3 }
44 44 XYPoint { x: 2.1; y: 2.1 }
45 45 XYPoint { x: 2.9; y: 4.9 }
46 46 XYPoint { x: 3.4; y: 3.0 }
47 47 XYPoint { x: 4.1; y: 3.3 }
48 48 }
49 49 }
@@ -1,64 +1,64
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 ChartView {
25 25 title: "user defined axes"
26 26
27 27 ValueAxis {
28 28 id: axisX
29 29 min: 0
30 30 max: 10
31 31 }
32 32
33 33 ValueAxis {
34 34 id: axisY
35 35 min: 0
36 36 max: 6
37 37 }
38 38
39 39 LineSeries {
40 40 name: "line series"
41 41 axisX: axisX
42 42 axisY: axisY
43 43 XYPoint { x: 0; y: 0 }
44 44 XYPoint { x: 1.1; y: 2.1 }
45 45 XYPoint { x: 1.9; y: 3.3 }
46 46 XYPoint { x: 2.1; y: 2.1 }
47 47 XYPoint { x: 2.9; y: 4.9 }
48 48 XYPoint { x: 3.4; y: 3.0 }
49 49 XYPoint { x: 4.1; y: 3.3 }
50 50 }
51 51
52 52 ScatterSeries {
53 53 name: "scatter series"
54 54 axisX: axisX
55 55 axisY: axisY
56 56 XYPoint { x: 0; y: 0 }
57 57 XYPoint { x: 1.1; y: 2.1 }
58 58 XYPoint { x: 1.9; y: 3.3 }
59 59 XYPoint { x: 2.1; y: 2.1 }
60 60 XYPoint { x: 2.9; y: 4.9 }
61 61 XYPoint { x: 3.4; y: 3.0 }
62 62 XYPoint { x: 4.1; y: 3.3 }
63 63 }
64 64 }
@@ -1,71 +1,71
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 ChartView {
25 25 id: chartView
26 26 title: "user defined axes"
27 27
28 28 ValueAxis {
29 29 id: axisX
30 30 min: 0
31 31 max: 10
32 32 // TODO: property to fix orientation to "X" to make this the X default axis for all series
33 33 // that don't have user defined X axis
34 34 }
35 35
36 36 ValueAxis {
37 37 id: axisY
38 38 min: 0
39 39 max: 5
40 40 // TODO: property to fix orientation to "Y" to make this the Y default axis for all series
41 41 // that don't have user defined Y axis
42 42 }
43 43
44 44 LineSeries {
45 45 name: "line series"
46 46 XYPoint { x: 0; y: 0 }
47 47 XYPoint { x: 1.1; y: 2.1 }
48 48 XYPoint { x: 1.9; y: 3.3 }
49 49 XYPoint { x: 2.1; y: 2.1 }
50 50 XYPoint { x: 2.9; y: 4.9 }
51 51 XYPoint { x: 3.4; y: 3.0 }
52 52 XYPoint { x: 4.1; y: 3.3 }
53 53 }
54 54
55 55 ScatterSeries {
56 56 name: "scatter series"
57 57 id: scatter
58 58 XYPoint { x: 0; y: 0 }
59 59 XYPoint { x: 1.1; y: 2.1 }
60 60 XYPoint { x: 1.9; y: 3.3 }
61 61 XYPoint { x: 2.1; y: 2.1 }
62 62 XYPoint { x: 2.9; y: 4.9 }
63 63 XYPoint { x: 3.4; y: 3.0 }
64 64 XYPoint { x: 4.1; y: 3.3 }
65 65 }
66 66
67 67 Component.onCompleted: {
68 68 // You can also set the axes dynamically
69 69 chartView.setAxisX(axisX, scatter);
70 70 }
71 71 }
@@ -1,74 +1,74
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 ChartView {
25 25 title: "configuring dynamically"
26 26 id: chartView
27 27 property int index: 0
28 28
29 29 Timer {
30 30 interval: 1000
31 31 repeat: true
32 32 running: true
33 33 onTriggered: {
34 34 switch (index) {
35 35 case 0:
36 36 chartView.axisX(lineSeries).max = 5;
37 37 chartView.axisY(lineSeries).max = 5;
38 38 break;
39 39 case 1:
40 40 chartView.axisX(scatterSeries).max = 10;
41 41 chartView.axisY(scatterSeries).max = 10;
42 42 break;
43 43 default:
44 44 chartView.axisX().max = 15;
45 45 chartView.axisY().max = 15;
46 46 }
47 47 index = (index + 1) % 3;
48 48 }
49 49 }
50 50
51 51 LineSeries {
52 52 id: lineSeries
53 53 name: "line series"
54 54 XYPoint { x: 0; y: 0 }
55 55 XYPoint { x: 1.1; y: 2.1 }
56 56 XYPoint { x: 1.9; y: 3.3 }
57 57 XYPoint { x: 2.1; y: 2.1 }
58 58 XYPoint { x: 2.9; y: 4.9 }
59 59 XYPoint { x: 3.4; y: 3.0 }
60 60 XYPoint { x: 4.1; y: 3.3 }
61 61 }
62 62
63 63 ScatterSeries {
64 64 id: scatterSeries
65 65 name: "scatter series"
66 66 XYPoint { x: 0; y: 0 }
67 67 XYPoint { x: 1.1; y: 2.1 }
68 68 XYPoint { x: 1.9; y: 3.3 }
69 69 XYPoint { x: 2.1; y: 2.1 }
70 70 XYPoint { x: 2.9; y: 4.9 }
71 71 XYPoint { x: 3.4; y: 3.0 }
72 72 XYPoint { x: 4.1; y: 3.3 }
73 73 }
74 74 }
@@ -1,84 +1,84
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 ChartView {
25 25 title: "series specific dynamic axes"
26 26 id: chartView
27 27 property int index: 0
28 28
29 29 Timer {
30 30 interval: 1000
31 31 repeat: true
32 32 running: true
33 33 onTriggered: {
34 34 switch (index) {
35 35 case 0:
36 36 lineAxisX.max = 5;
37 37 lineAxisY.max = 5;
38 38 scatterAxisX.max = 10;
39 39 scatterAxisY.max = 10;
40 40 break;
41 41 case 1:
42 42 lineAxisX.max = 10;
43 43 lineAxisY.max = 10;
44 44 scatterAxisX.max = 5;
45 45 scatterAxisY.max = 5;
46 46 break;
47 47 default:
48 48 chartView.axisX().max = 2;
49 49 chartView.axisY().max = 2;
50 50 }
51 51 index = (index + 1) % 3;
52 52 }
53 53 }
54 54
55 55 LineSeries {
56 56 id: lineSeries
57 57 name: "line series"
58 58 axisX: ValueAxis { id: lineAxisX }
59 59 axisY: ValueAxis { id: lineAxisY }
60 60
61 61 XYPoint { x: 0; y: 0 }
62 62 XYPoint { x: 1.1; y: 2.1 }
63 63 XYPoint { x: 1.9; y: 3.3 }
64 64 XYPoint { x: 2.1; y: 2.1 }
65 65 XYPoint { x: 2.9; y: 4.9 }
66 66 XYPoint { x: 3.4; y: 3.0 }
67 67 XYPoint { x: 4.1; y: 3.3 }
68 68 }
69 69
70 70 ScatterSeries {
71 71 id: scatterSeries
72 72 name: "scatter series"
73 73 axisX: ValueAxis { id: scatterAxisX }
74 74 axisY: ValueAxis { id: scatterAxisY }
75 75
76 76 XYPoint { x: 0; y: 0 }
77 77 XYPoint { x: 1.1; y: 2.1 }
78 78 XYPoint { x: 1.9; y: 3.3 }
79 79 XYPoint { x: 2.1; y: 2.1 }
80 80 XYPoint { x: 2.9; y: 4.9 }
81 81 XYPoint { x: 3.4; y: 3.0 }
82 82 XYPoint { x: 4.1; y: 3.3 }
83 83 }
84 84 }
@@ -1,66 +1,66
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 ChartView {
25 25 id: chartView
26 26 title: "dynamically created series"
27 27 property int index: 0
28 28
29 29 Timer {
30 30 interval: 1000
31 31 repeat: true
32 32 running: true
33 33 onTriggered: {
34 34 switch (index) {
35 35 case 0:
36 36 while (chartView.count)
37 37 chartView.series(0).destroy();
38 38 var line = chartView.createSeries(ChartView.SeriesTypeLine, "line");
39 39 line.append(0, 0);
40 40 line.append(1.1, 2.1);
41 41 line.append(1.9, 3.3);
42 42 line.append(2.1, 2.1);
43 43 line.append(2.9, 4.9);
44 44 line.append(3.4, 3.0);
45 45 line.append(4.1, 3.3);
46 46 break;
47 47 case 1:
48 48 chartView.axisX().min = 0;
49 49 chartView.axisX().max = 4.5;
50 50 chartView.axisY().min = 0;
51 51 chartView.axisY().max = 4.5;
52 52 break;
53 53 default:
54 54 var scatter = chartView.createSeries(ChartView.SeriesTypeScatter, "scatter");
55 55 scatter.append(0, 0);
56 56 scatter.append(1.1, 2.1);
57 57 scatter.append(1.9, 3.3);
58 58 scatter.append(2.1, 2.1);
59 59 scatter.append(2.9, 4.9);
60 60 scatter.append(3.4, 3.0);
61 61 scatter.append(4.1, 3.3);
62 62 }
63 63 index = (index + 1) % 3;
64 64 }
65 65 }
66 66 }
@@ -1,64 +1,64
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 ChartView {
25 25 id: chartView
26 26 title: "switching axes dynamically"
27 27
28 28 Timer {
29 29 interval: 1000
30 30 repeat: true
31 31 running: true
32 32 onTriggered: {
33 33 if (lineSeries.axisX == valueAxis1)
34 34 lineSeries.axisX = valueAxis2;
35 35 else
36 36 lineSeries.axisX = valueAxis1;
37 37 }
38 38 }
39 39
40 40 ValueAxis {
41 41 id: valueAxis1
42 42 min: 0
43 43 max: 5
44 44 }
45 45
46 46 ValueAxis {
47 47 id: valueAxis2
48 48 min: 1
49 49 max: 6
50 50 }
51 51
52 52 LineSeries {
53 53 id: lineSeries
54 54 name: "line series"
55 55 axisX: valueAxis1
56 56 XYPoint { x: 0; y: 0 }
57 57 XYPoint { x: 1.1; y: 2.1 }
58 58 XYPoint { x: 1.9; y: 3.3 }
59 59 XYPoint { x: 2.1; y: 2.1 }
60 60 XYPoint { x: 2.9; y: 4.9 }
61 61 XYPoint { x: 3.4; y: 3.0 }
62 62 XYPoint { x: 4.1; y: 3.3 }
63 63 }
64 64 }
@@ -1,43 +1,43
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 ChartView {
25 25 id: chartView
26 26 title: "axis scale; different series"
27 27
28 28 LineSeries {
29 29 name: "line series"
30 30 XYPoint { x: 0; y: 0 }
31 31 XYPoint { x: 1.1; y: 2.1 }
32 32 XYPoint { x: 1.9; y: 3.3 }
33 33 XYPoint { x: 2.1; y: 2.1 }
34 34 }
35 35
36 36 ScatterSeries {
37 37 name: "scatter series"
38 38 XYPoint { x: 2.1; y: 2.1 }
39 39 XYPoint { x: 2.9; y: 4.9 }
40 40 XYPoint { x: 3.4; y: 3.0 }
41 41 XYPoint { x: 4.1; y: 3.3 }
42 42 }
43 43 }
@@ -1,56 +1,56
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 ChartView {
25 25 id: chartView
26 26 title: "Deprecated code"
27 27 property int index: 0
28 28
29 29 Component.onCompleted: {
30 30 // Calling createDefaultAxes in onCompleted is now deprecated. It needs to be tested,
31 31 // though, because some application may still use it
32 32 chartView.createDefaultAxes();
33 33 }
34 34
35 35 LineSeries {
36 36 name: "line series"
37 37 XYPoint { x: 0; y: 0 }
38 38 XYPoint { x: 1.1; y: 2.1 }
39 39 XYPoint { x: 1.9; y: 3.3 }
40 40 XYPoint { x: 2.1; y: 2.1 }
41 41 XYPoint { x: 2.9; y: 4.9 }
42 42 XYPoint { x: 3.4; y: 3.0 }
43 43 XYPoint { x: 4.1; y: 3.3 }
44 44 }
45 45
46 46 ScatterSeries {
47 47 name: "scatter series"
48 48 XYPoint { x: 0; y: 0 }
49 49 XYPoint { x: 1.1; y: 2.1 }
50 50 XYPoint { x: 1.9; y: 3.3 }
51 51 XYPoint { x: 2.1; y: 2.1 }
52 52 XYPoint { x: 2.9; y: 4.9 }
53 53 XYPoint { x: 3.4; y: 3.0 }
54 54 XYPoint { x: 4.1; y: 3.3 }
55 55 }
56 56 }
@@ -1,98 +1,98
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 ChartView {
25 25 title: "area series"
26 26 anchors.fill: parent
27 27 animationOptions: ChartView.SeriesAnimations
28 28
29 29 property variant series: areaSeries
30 30
31 31 AreaSeries {
32 32 id: areaSeries
33 33 name: "area 1"
34 34
35 35 upperSeries: LineSeries {
36 36 XYPoint { x: 0; y: 1 }
37 37 XYPoint { x: 1; y: 1 }
38 38 XYPoint { x: 2; y: 3 }
39 39 XYPoint { x: 3; y: 3 }
40 40 XYPoint { x: 4; y: 2 }
41 41 XYPoint { x: 5; y: 0 }
42 42 XYPoint { x: 6; y: 2 }
43 43 XYPoint { x: 7; y: 1 }
44 44 XYPoint { x: 8; y: 2 }
45 45 XYPoint { x: 9; y: 1 }
46 46 XYPoint { x: 10; y: 3 }
47 47 XYPoint { x: 11; y: 3 }
48 48 }
49 49 lowerSeries: LineSeries {
50 50 XYPoint { x: 0; y: 0 }
51 51 XYPoint { x: 1; y: 0 }
52 52 XYPoint { x: 2; y: 0 }
53 53 XYPoint { x: 3; y: 0 }
54 54 XYPoint { x: 4; y: 0 }
55 55 XYPoint { x: 5; y: 0 }
56 56 XYPoint { x: 6; y: 0 }
57 57 XYPoint { x: 7; y: 0 }
58 58 XYPoint { x: 8; y: 0 }
59 59 XYPoint { x: 9; y: 0 }
60 60 XYPoint { x: 10; y: 0 }
61 61 XYPoint { x: 11; y: 0 }
62 62 }
63 63
64 64 onNameChanged: console.log(name + ".onNameChanged: " + name);
65 65 onVisibleChanged: console.log(name + ".onVisibleChanged: " + visible);
66 66 onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y);
67 67 onSelected: console.log(name + ".onSelected");
68 68 onColorChanged: console.log(name + ".onColorChanged: " + color);
69 69 onBorderColorChanged: console.log(name + ".onBorderColorChanged: " + borderColor);
70 70 // onCountChanged: console.log(name + ".onCountChanged: " + count);
71 71 }
72 72
73 73 AreaSeries {
74 74 name: "area 2"
75 75
76 76 upperSeries: LineSeries {
77 77 XYPoint { x: 0; y: 0.5 }
78 78 XYPoint { x: 1; y: 1.5 }
79 79 XYPoint { x: 2; y: 0.3 }
80 80 XYPoint { x: 3; y: 1.5 }
81 81 XYPoint { x: 4; y: 0.1 }
82 82 XYPoint { x: 5; y: 0.3 }
83 83 XYPoint { x: 6; y: 1.2 }
84 84 XYPoint { x: 7; y: 1.3 }
85 85 XYPoint { x: 8; y: 0.2 }
86 86 XYPoint { x: 9; y: 0.1 }
87 87 XYPoint { x: 10; y: 3.2 }
88 88 XYPoint { x: 11; y: 4.6 }
89 89 }
90 90
91 91 onNameChanged: console.log(name + ".onNameChanged: " + name);
92 92 onVisibleChanged: console.log(name + ".onVisibleChanged: " + visible);
93 93 onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y);
94 94 onSelected: console.log(name + ".onSelected");
95 95 onColorChanged: console.log(name + ".onColorChanged: " + color);
96 96 onBorderColorChanged: console.log(name + ".onBorderColorChanged: " + borderColor);
97 97 }
98 98 }
@@ -1,64 +1,64
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 ChartView {
25 25 title: "Bar series"
26 26 anchors.fill: parent
27 27 theme: ChartView.ChartThemeLight
28 28 legend.alignment: Qt.AlignBottom
29 29 animationOptions: ChartView.SeriesAnimations
30 30
31 31 property variant series: mySeries
32 32
33 33
34 34 BarSeries {
35 35 id: mySeries
36 36 name: "bar"
37 axisX: BarCategoriesAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] }
37 axisX: BarCategoryAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] }
38 38 BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6]
39 39 onClicked: console.log("barset.onClicked: " + index);
40 40 onHovered: console.log("barset.onHovered: " + status);
41 41 onPenChanged: console.log("barset.onPenChanged: " + pen);
42 42 onBrushChanged: console.log("barset.onBrushChanged: " + brush);
43 43 onLabelChanged: console.log("barset.onLabelChanged: " + label);
44 44 onLabelBrushChanged: console.log("barset.onLabelBrushChanged: " + labelBrush);
45 45 onLabelFontChanged: console.log("barset.onLabelFontChanged: " + labelFont);
46 46 onColorChanged: console.log("barset.onColorChanged: " + color);
47 47 onBorderColorChanged: console.log("barset.onBorderColorChanged: " + color);
48 48 onLabelColorChanged: console.log("barset.onLabelColorChanged: " + color);
49 49 onCountChanged: console.log("barset.onCountChanged: " + count);
50 50 onValuesAdded: console.log("barset.onValuesAdded: " + index + ", " + count);
51 51 onValuesRemoved: console.log("barset.onValuesRemoved: " + index + ", " + count);
52 52 onValueChanged: console.log("barset.onValuesChanged: " + index);
53 53 }
54 54 BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] }
55 55 BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] }
56 56
57 57 onNameChanged: console.log("groupedBarSeries.onNameChanged: " + series.name);
58 58 onVisibleChanged: console.log("groupedBarSeries.onVisibleChanged: " + series.visible);
59 59 onClicked: console.log("groupedBarSeries.onClicked: " + barset + " " + index);
60 60 onHovered: console.log("groupedBarSeries.onHovered: " + barset + " " + status);
61 61 onLabelsVisibleChanged: console.log("groupedBarSeries.onLabelsVisibleChanged: " + series.labelsVisible);
62 62 onCountChanged: console.log("groupedBarSeries.onCountChanged: " + count);
63 63 }
64 64 }
@@ -1,110 +1,110
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 ChartView {
25 25 id: chartView
26 26 title: "Chart Title"
27 27 anchors.fill: parent
28 28 property variant series: chartView
29 29
30 30 LineSeries {
31 31 name: "line"
32 32 XYPoint { x: 0; y: 0 }
33 33 XYPoint { x: 1.1; y: 2.1 }
34 34 XYPoint { x: 1.9; y: 3.3 }
35 35 XYPoint { x: 2.1; y: 2.1 }
36 36 XYPoint { x: 2.9; y: 4.9 }
37 37 XYPoint { x: 3.4; y: 3.0 }
38 38 XYPoint { x: 4.1; y: 3.3 }
39 39 }
40 40
41 41 onVisibleChanged: console.log("chart.onVisibleChanged: " + visible);
42 42 onTitleColorChanged: console.log("chart.onTitleColorChanged: " + color);
43 43 onBackgroundColorChanged: console.log("chart.onBackgroundColorChanged: " + series.backgroundColor);
44 44 onDropShadowEnabledChanged: console.log("chart.onDropShadowEnabledChanged: " + enabled);
45 45 onTopMarginChanged: {
46 46 console.log("chart.onTopMarginChanged: " + margin);
47 47 marginVisualizer.opacity = 1.0;
48 48 }
49 49 onBottomMarginChanged: {
50 50 console.log("chart.onBottomMarginChanged: " + margin);
51 51 marginVisualizer.opacity = 1.0;
52 52 }
53 53 onLeftMarginChanged: {
54 54 console.log("chart.onLeftMarginChanged: " + margin);
55 55 marginVisualizer.opacity = 1.0;
56 56 }
57 57 onRightMarginChanged: {
58 58 console.log("chart.onRightMarginChanged: " + margin);
59 59 marginVisualizer.opacity = 1.0;
60 60 }
61 61
62 62 legend.onVisibleChanged: console.log("legend.onVisibleChanged: " + series.legend.visible);
63 63 legend.onBackgroundVisibleChanged: console.log("legend.onBackgroundVisibleChanged: " + visible);
64 64 legend.onColorChanged: console.log("legend.onColorChanged: " + color);
65 65 legend.onBorderColorChanged: console.log("legend.onBorderColorChanged: " + color);
66 66 legend.onLabelColorChanged: console.log("legend.onLabelColorChanged: " + color);
67 67
68 68
69 69 ValueAxis{
70 onColorChanged: console.log("axisX.onColorChanged: " + color);
71 onLabelsVisibleChanged: console.log("axisX.onLabelsVisibleChanged: " + visible);
72 onLabelsColorChanged: console.log("axisX.onLabelsColorChanged: " + color);
73 onVisibleChanged: console.log("axisX.onVisibleChanged: " + visible);
74 onGridVisibleChanged: console.log("axisX.onGridVisibleChanged: " + visible);
75 onShadesVisibleChanged: console.log("axisX.onShadesVisibleChanged: " + visible);
76 onShadesColorChanged: console.log("axisX.onShadesColorChanged: " + color);
77 onShadesBorderColorChanged: console.log("axisX.onShadesBorderColorChanged: " + color);
78 onMinChanged: console.log("axisX.onMinChanged: " + min);
79 onMaxChanged: console.log("axisX.onMaxChanged: " + max);
70 onColorChanged: console.log("axisX.onColorChanged: " + color);
71 onLabelsVisibleChanged: console.log("axisX.onLabelsVisibleChanged: " + visible);
72 onLabelsColorChanged: console.log("axisX.onLabelsColorChanged: " + color);
73 onVisibleChanged: console.log("axisX.onVisibleChanged: " + visible);
74 onGridVisibleChanged: console.log("axisX.onGridVisibleChanged: " + visible);
75 onShadesVisibleChanged: console.log("axisX.onShadesVisibleChanged: " + visible);
76 onShadesColorChanged: console.log("axisX.onShadesColorChanged: " + color);
77 onShadesBorderColorChanged: console.log("axisX.onShadesBorderColorChanged: " + color);
78 onMinChanged: console.log("axisX.onMinChanged: " + min);
79 onMaxChanged: console.log("axisX.onMaxChanged: " + max);
80 80 }
81 81
82 82 ValueAxis{
83 onColorChanged: console.log("axisY.onColorChanged: " + color);
84 onLabelsVisibleChanged: console.log("axisY.onLabelsVisibleChanged: " + visible);
85 onLabelsColorChanged: console.log("axisY.onLabelsColorChanged: " + color);
86 onVisibleChanged: console.log("axisY.onVisibleChanged: " + visible);
87 onGridVisibleChanged: console.log("axisY.onGridVisibleChanged: " + visible);
88 onShadesVisibleChanged: console.log("axisY.onShadesVisibleChanged: " + visible);
89 onShadesColorChanged: console.log("axisY.onShadesColorChanged: " + color);
90 onShadesBorderColorChanged: console.log("axisY.onShadesBorderColorChanged: " + color);
91 onMinChanged: console.log("axisY.onMinChanged: " + min);
92 onMaxChanged: console.log("axisY.onMaxChanged: " + max);
83 onColorChanged: console.log("axisY.onColorChanged: " + color);
84 onLabelsVisibleChanged: console.log("axisY.onLabelsVisibleChanged: " + visible);
85 onLabelsColorChanged: console.log("axisY.onLabelsColorChanged: " + color);
86 onVisibleChanged: console.log("axisY.onVisibleChanged: " + visible);
87 onGridVisibleChanged: console.log("axisY.onGridVisibleChanged: " + visible);
88 onShadesVisibleChanged: console.log("axisY.onShadesVisibleChanged: " + visible);
89 onShadesColorChanged: console.log("axisY.onShadesColorChanged: " + color);
90 onShadesBorderColorChanged: console.log("axisY.onShadesBorderColorChanged: " + color);
91 onMinChanged: console.log("axisY.onMinChanged: " + min);
92 onMaxChanged: console.log("axisY.onMaxChanged: " + max);
93 93 }
94 94
95 95 Rectangle {
96 96 id: marginVisualizer
97 97 color: "transparent"
98 98 border.color: "red"
99 99 anchors.fill: parent
100 100 anchors.topMargin: parent.topMargin
101 101 anchors.bottomMargin: parent.bottomMargin
102 102 anchors.leftMargin: parent.leftMargin
103 103 anchors.rightMargin: parent.rightMargin
104 104 opacity: 0.0
105 105 onOpacityChanged: if (opacity > 0.9) opacity = 0.0;
106 106 Behavior on opacity {
107 107 NumberAnimation { duration: 800 }
108 108 }
109 109 }
110 110 }
@@ -1,62 +1,62
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 ChartView {
25 25 property variant series: lineSeries
26 26
27 27 title: "line series"
28 28 anchors.fill: parent
29 29 animationOptions: ChartView.SeriesAnimations
30 30
31 31 LineSeries {
32 32 id: lineSeries
33 33 name: "line 1"
34 34 XYPoint { x: 0; y: 0 }
35 35 XYPoint { x: 1.1; y: 2.1 }
36 36 XYPoint { x: 1.9; y: 3.3 }
37 37 XYPoint { x: 2.1; y: 2.1 }
38 38 XYPoint { x: 2.9; y: 4.9 }
39 39 XYPoint { x: 3.4; y: 3.0 }
40 40 XYPoint { x: 4.1; y: 3.3 }
41 41
42 42 onNameChanged: console.log("lineSeries.onNameChanged: " + name);
43 43 onVisibleChanged: console.log("lineSeries.onVisibleChanged: " + visible);
44 44 onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y);
45 45 onPointReplaced: console.log("lineSeries.onPointReplaced: " + index);
46 46 onPointRemoved: console.log("lineSeries.onPointRemoved: " + index);
47 47 onPointAdded: console.log("lineSeries.onPointAdded: " + series.at(index).x + ", " + series.at(index).y);
48 48 onColorChanged: console.log("lineSeries.onColorChanged: " + color);
49 49 onCountChanged: console.log("lineSeries.onCountChanged: " + count);
50 50 }
51 51
52 52 LineSeries {
53 53 name: "line 2"
54 54 XYPoint { x: 1.1; y: 1.1 }
55 55 XYPoint { x: 1.9; y: 2.3 }
56 56 XYPoint { x: 2.1; y: 1.1 }
57 57 XYPoint { x: 2.9; y: 3.9 }
58 58 XYPoint { x: 3.4; y: 2.0 }
59 59 XYPoint { x: 4.1; y: 2.3 }
60 60 onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y);
61 61 }
62 62 }
@@ -1,64 +1,64
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 ChartView {
25 25 title: "Percent bar series"
26 26 anchors.fill: parent
27 27 theme: ChartView.ChartThemeLight
28 28 legend.alignment: Qt.AlignBottom
29 29 animationOptions: ChartView.SeriesAnimations
30 30
31 31 property variant series: mySeries
32 32
33 33 PercentBarSeries {
34 34 id: mySeries
35 35 name: "bar"
36 axisX: BarCategoriesAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] }
36 axisX: BarCategoryAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] }
37 37
38 38 BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6]
39 39 onClicked: console.log("barset.onClicked: " + index);
40 40 onHovered: console.log("barset.onHovered: " + status);
41 41 onPenChanged: console.log("barset.onPenChanged: " + pen);
42 42 onBrushChanged: console.log("barset.onBrushChanged: " + brush);
43 43 onLabelChanged: console.log("barset.onLabelChanged: " + label);
44 44 onLabelBrushChanged: console.log("barset.onLabelBrushChanged: " + labelBrush);
45 45 onLabelFontChanged: console.log("barset.onLabelFontChanged: " + labelFont);
46 46 onColorChanged: console.log("barset.onColorChanged: " + color);
47 47 onBorderColorChanged: console.log("barset.onBorderColorChanged: " + color);
48 48 onLabelColorChanged: console.log("barset.onLabelColorChanged: " + color);
49 49 onCountChanged: console.log("barset.onCountChanged: " + count);
50 50 onValuesAdded: console.log("barset.onValuesAdded: " + index + ", " + count);
51 51 onValuesRemoved: console.log("barset.onValuesRemoved: " + index + ", " + count);
52 52 onValueChanged: console.log("barset.onValuesChanged: " + index);
53 53 }
54 54 BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] }
55 55 BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] }
56 56
57 57 onNameChanged: console.log("percentBarSeries.onNameChanged: " + series.name);
58 58 onVisibleChanged: console.log("percentBarSeries.onVisibleChanged: " + series.visible);
59 59 onClicked: console.log("percentBarSeries.onClicked: " + barset + " " + index);
60 60 onHovered: console.log("percentBarSeries.onHovered: " + barset + " " + status);
61 61 onLabelsVisibleChanged: console.log("percentBarSeries.onLabelsVisibleChanged: " + series.labelsVisible);
62 62 onCountChanged: console.log("percentBarSeries.onCountChanged: " + count);
63 63 }
64 64 }
@@ -1,66 +1,66
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 ChartView {
25 25 id: chart
26 26 title: "pie series"
27 27 animationOptions: ChartView.SeriesAnimations
28 28
29 29 property variant series: pieSeries
30 30
31 31 PieSeries {
32 32 id: pieSeries
33 33 name: "pie"
34 34 PieSlice { label: "slice1"; value: 11;
35 35 onValueChanged: console.log("slice.onValueChanged: " + value);
36 36 onLabelVisibleChanged: console.log("slice.onLabelVisibleChanged: " + labelVisible);
37 37 onPenChanged: console.log("slice.onPenChanged: " + pen);
38 38 onBorderColorChanged: console.log("slice.onBorderColorChanged: " + borderColor);
39 39 onBorderWidthChanged: console.log("slice.onBorderWidthChanged: " + borderWidth);
40 40 onBrushChanged: console.log("slice.onBrushChanged: " + brush);
41 41 onColorChanged: console.log("slice.onColorChanged: " + color);
42 42 onLabelColorChanged: console.log("slice.onLabelColorChanged: " + labelColor);
43 43 onLabelBrushChanged: console.log("slice.onLabelBrushChanged: " + labelBrush);
44 44 onLabelFontChanged: console.log("slice.onLabelFontChanged: " + labelFont);
45 45 onPercentageChanged: console.log("slice.onPercentageChanged: " + percentage);
46 46 onStartAngleChanged: console.log("slice.onStartAngleChanged: " + startAngle);
47 47 onAngleSpanChanged: console.log("slice.onAngleSpanChanged: " + angleSpan);
48 48 onClicked: console.log("slice.onClicked: " + label);
49 49 onHovered: console.log("slice.onHovered: " + state);
50 50 }
51 51 PieSlice { label: "slice2"; value: 22 }
52 52 PieSlice { label: "slice3"; value: 33 }
53 53 PieSlice { label: "slice4"; value: 44 }
54 54
55 55 onNameChanged: console.log("pieSeries.onNameChanged: " + series.name);
56 56 onVisibleChanged: console.log("pieSeries.onVisibleChanged: " + series.visible);
57 57 onClicked: console.log("pieSeries.onClicked: " + slice.label);
58 58 onHovered: console.log("pieSeries.onHovered: " + slice.label);
59 59 onAdded: console.log("pieSeries.onAdded: " + slices);
60 60 onSliceAdded: console.log("pieSeries.onSliceAdded: " + slice.label);
61 61 onRemoved: console.log("pieSeries.onRemoved: " + slices);
62 62 onSliceRemoved: console.log("pieSeries.onSliceRemoved: " + slice.label);
63 63 onCountChanged: console.log("pieSeries.onCountChanged: " + series.count);
64 64 onSumChanged: console.log("pieSeries.onSumChanged: " + series.sum);
65 65 }
66 66 }
@@ -1,61 +1,61
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 ChartView {
25 25 title: "scatter series"
26 26 property variant series: scatterSeries
27 27 animationOptions: ChartView.SeriesAnimations
28 28
29 29 ScatterSeries {
30 30 id: scatterSeries
31 31 name: "scatter 1"
32 32 XYPoint { x: 1.5; y: 1.5 }
33 33 XYPoint { x: 1.5; y: 1.6 }
34 34 XYPoint { x: 1.57; y: 1.55 }
35 35 XYPoint { x: 1.8; y: 1.8 }
36 36 XYPoint { x: 1.9; y: 1.6 }
37 37 XYPoint { x: 2.1; y: 1.3 }
38 38 XYPoint { x: 2.5; y: 2.1 }
39 39
40 40 onNameChanged: console.log("scatterSeries.onNameChanged: " + name);
41 41 onVisibleChanged: console.log("scatterSeries.onVisibleChanged: " + visible);
42 42 onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y);
43 43 onPointReplaced: console.log("scatterSeries.onPointReplaced: " + index);
44 44 onPointRemoved: console.log("scatterSeries.onPointRemoved: " + index);
45 45 onPointAdded: console.log("scatterSeries.onPointAdded: " + series.at(index).x + ", " + series.at(index).y);
46 46 onColorChanged: console.log("scatterSeries.onColorChanged: " + color);
47 47 onBorderColorChanged: console.log("scatterSeries.onBorderColorChanged: " + borderColor);
48 48 onCountChanged: console.log("scatterSeries.onCountChanged: " + count);
49 49 }
50 50
51 51 ScatterSeries {
52 52 name: "scatter2"
53 53 XYPoint { x: 2.0; y: 2.0 }
54 54 XYPoint { x: 2.0; y: 2.1 }
55 55 XYPoint { x: 2.07; y: 2.05 }
56 56 XYPoint { x: 2.2; y: 2.9 }
57 57 XYPoint { x: 2.4; y: 2.7 }
58 58 XYPoint { x: 2.67; y: 2.65 }
59 59 onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y);
60 60 }
61 61 }
@@ -1,61 +1,61
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 ChartView {
25 25 title: "spline series"
26 26 anchors.fill: parent
27 27 property variant series: splineSeries
28 28 animationOptions: ChartView.SeriesAnimations
29 29
30 30 SplineSeries {
31 31 id: splineSeries
32 32 name: "spline 1"
33 33 XYPoint { x: 0; y: 0 }
34 34 XYPoint { x: 1.1; y: 2.1 }
35 35 XYPoint { x: 1.9; y: 3.3 }
36 36 XYPoint { x: 2.1; y: 2.1 }
37 37 XYPoint { x: 2.9; y: 4.9 }
38 38 XYPoint { x: 3.4; y: 3.0 }
39 39 XYPoint { x: 4.1; y: 3.3 }
40 40
41 41 onNameChanged: console.log("splineSeries.onNameChanged: " + name);
42 42 onVisibleChanged: console.log("splineSeries.onVisibleChanged: " + visible);
43 43 onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y);
44 44 onPointReplaced: console.log("splineSeries.onPointReplaced: " + index);
45 45 onPointRemoved: console.log("splineSeries.onPointRemoved: " + index);
46 46 onPointAdded: console.log("splineSeries.onPointAdded: " + series.at(index).x + ", " + series.at(index).y);
47 47 onColorChanged: console.log("splineSeries.onColorChanged: " + color);
48 48 onCountChanged: console.log("splineSeries.onCountChanged: " + count);
49 49 }
50 50
51 51 SplineSeries {
52 52 name: "spline 2"
53 53 XYPoint { x: 1.1; y: 1.1 }
54 54 XYPoint { x: 1.9; y: 2.3 }
55 55 XYPoint { x: 2.1; y: 1.1 }
56 56 XYPoint { x: 2.9; y: 3.9 }
57 57 XYPoint { x: 3.4; y: 2.0 }
58 58 XYPoint { x: 4.1; y: 2.3 }
59 59 onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y);
60 60 }
61 61 }
@@ -1,63 +1,63
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
22 import QtCommercial.Chart 1.1
23 23
24 24 ChartView {
25 25 title: "Stacked bar series"
26 26 anchors.fill: parent
27 27 theme: ChartView.ChartThemeLight
28 28 legend.alignment: Qt.AlignBottom
29 29 animationOptions: ChartView.SeriesAnimations
30 30
31 31 property variant series: mySeries
32 32
33 33 StackedBarSeries {
34 34 id: mySeries
35 35 name: "bar"
36 axisX: BarCategoriesAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] }
36 axisX: BarCategoryAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] }
37 37 BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6]
38 38 onClicked: console.log("barset.onClicked: " + index);
39 39 onHovered: console.log("barset.onHovered: " + status);
40 40 onPenChanged: console.log("barset.onPenChanged: " + pen);
41 41 onBrushChanged: console.log("barset.onBrushChanged: " + brush);
42 42 onLabelChanged: console.log("barset.onLabelChanged: " + label);
43 43 onLabelBrushChanged: console.log("barset.onLabelBrushChanged: " + labelBrush);
44 44 onLabelFontChanged: console.log("barset.onLabelFontChanged: " + labelFont);
45 45 onColorChanged: console.log("barset.onColorChanged: " + color);
46 46 onBorderColorChanged: console.log("barset.onBorderColorChanged: " + color);
47 47 onLabelColorChanged: console.log("barset.onLabelColorChanged: " + color);
48 48 onCountChanged: console.log("barset.onCountChanged: " + count);
49 49 onValuesAdded: console.log("barset.onValuesAdded: " + index + ", " + count);
50 50 onValuesRemoved: console.log("barset.onValuesRemoved: " + index + ", " + count);
51 51 onValueChanged: console.log("barset.onValuesChanged: " + index);
52 52 }
53 53 BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] }
54 54 BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] }
55 55
56 56 onNameChanged: console.log("stackedBarSeries.onNameChanged: " + series.name);
57 57 onVisibleChanged: console.log("stackedBarSeries.onVisibleChanged: " + series.visible);
58 58 onClicked: console.log("stackedBarSeries.onClicked: " + barset + " " + index);
59 59 onHovered: console.log("stackedBarSeries.onHovered: " + barset + " " + status);
60 60 onLabelsVisibleChanged: console.log("stackedBarSeries.onLabelsVisibleChanged: " + series.labelsVisible);
61 61 onCountChanged: console.log("stackedBarSeries.onCountChanged: " + count);
62 62 }
63 63 }
General Comments 0
You need to be logged in to leave comments. Login now