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