##// END OF EJS Templates
Fixed a few missed QMLs for QML API versioning
Tero Ahola -
r1860:9e429429873f
parent child
Show More
@@ -1,90 +1,89
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
23
22
24 Rectangle {
23 Rectangle {
25 width: parent.width
24 width: parent.width
26 height: parent.height
25 height: parent.height
27 property int viewNumber: 1
26 property int viewNumber: 1
28
27
29 Loader {
28 Loader {
30 id: loader
29 id: loader
31 anchors.fill: parent
30 anchors.fill: parent
32 source: "View" + viewNumber + ".qml";
31 source: "View" + viewNumber + ".qml";
33 }
32 }
34
33
35 Rectangle {
34 Rectangle {
36 id: infoText
35 id: infoText
37 anchors.centerIn: parent
36 anchors.centerIn: parent
38 width: parent.width
37 width: parent.width
39 height: 40
38 height: 40
40 color: "black"
39 color: "black"
41 Text {
40 Text {
42 color: "white"
41 color: "white"
43 anchors.centerIn: parent
42 anchors.centerIn: parent
44 text: "Use left and right arrow keys to navigate between chart types"
43 text: "Use left and right arrow keys to navigate between chart types"
45 }
44 }
46
45
47 Behavior on opacity {
46 Behavior on opacity {
48 NumberAnimation { duration: 400 }
47 NumberAnimation { duration: 400 }
49 }
48 }
50 }
49 }
51
50
52 MouseArea {
51 MouseArea {
53 focus: true
52 focus: true
54 anchors.fill: parent
53 anchors.fill: parent
55 onClicked: {
54 onClicked: {
56 if (infoText.opacity > 0) {
55 if (infoText.opacity > 0) {
57 infoText.opacity = 0.0;
56 infoText.opacity = 0.0;
58 } else {
57 } else {
59 nextView();
58 nextView();
60 }
59 }
61 }
60 }
62 Keys.onPressed: {
61 Keys.onPressed: {
63 if (infoText.opacity > 0) {
62 if (infoText.opacity > 0) {
64 infoText.opacity = 0.0;
63 infoText.opacity = 0.0;
65 } else {
64 } else {
66 if (event.key == Qt.Key_Left) {
65 if (event.key == Qt.Key_Left) {
67 previousView();
66 previousView();
68 } else {
67 } else {
69 nextView();
68 nextView();
70 }
69 }
71 }
70 }
72 }
71 }
73 }
72 }
74
73
75 function nextView() {
74 function nextView() {
76 var i = viewNumber + 1;
75 var i = viewNumber + 1;
77 if (i > 12)
76 if (i > 12)
78 viewNumber = 1;
77 viewNumber = 1;
79 else
78 else
80 viewNumber = i;
79 viewNumber = i;
81 }
80 }
82
81
83 function previousView() {
82 function previousView() {
84 var i = viewNumber - 1;
83 var i = viewNumber - 1;
85 if (i <= 0)
84 if (i <= 0)
86 viewNumber = 12;
85 viewNumber = 12;
87 else
86 else
88 viewNumber = i;
87 viewNumber = i;
89 }
88 }
90 }
89 }
@@ -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 width: parent.width
25 width: parent.width
26 height: parent.height
26 height: parent.height
27 property int __activeIndex: 1
27 property int __activeIndex: 1
28 property real __intervalCoefficient: 0
28 property real __intervalCoefficient: 0
29
29
30 //![1]
30 //![1]
31 ChartView {
31 ChartView {
32 id: chartView
32 id: chartView
33 anchors.fill: parent
33 anchors.fill: parent
34 title: "Wheel of fortune"
34 title: "Wheel of fortune"
35 legend.visible: false
35 legend.visible: false
36
36
37 PieSeries {
37 PieSeries {
38 id: wheelOfFortune
38 id: wheelOfFortune
39 horizontalPosition: 0.3
39 horizontalPosition: 0.3
40 }
40 }
41
41
42 SplineSeries {
42 SplineSeries {
43 id: splineSeries
43 id: splineSeries
44 }
44 }
45
45
46 ScatterSeries {
46 ScatterSeries {
47 id: scatterSeries
47 id: scatterSeries
48 }
48 }
49 }
49 }
50 //![1]
50 //![1]
51
51
52 //![2]
52 //![2]
53 Component.onCompleted: {
53 Component.onCompleted: {
54 __intervalCoefficient = Math.random() + 0.1;
54 __intervalCoefficient = Math.random() + 0.1;
55
55
56 for (var i = 0; i < 20; i++)
56 for (var i = 0; i < 20; i++)
57 wheelOfFortune.append("", 1);
57 wheelOfFortune.append("", 1);
58
58
59 var interval = 1;
59 var interval = 1;
60 for (var j = 0; interval < 800; j++) {
60 for (var j = 0; interval < 800; j++) {
61 interval = __intervalCoefficient * j * j;
61 interval = __intervalCoefficient * j * j;
62 splineSeries.append(j, interval);
62 splineSeries.append(j, interval);
63 }
63 }
64 chartView.axisX(scatterSeries).max = j;
64 chartView.axisX(scatterSeries).max = j;
65 chartView.axisY(scatterSeries).max = 1000;
65 chartView.axisY(scatterSeries).max = 1000;
66 }
66 }
67 //![2]
67 //![2]
68
68
69 Timer {
69 Timer {
70 triggeredOnStart: true
70 triggeredOnStart: true
71 running: true
71 running: true
72 repeat: true
72 repeat: true
73 interval: 100
73 interval: 100
74 onTriggered: {
74 onTriggered: {
75 var index = __activeIndex % wheelOfFortune.count;
75 var index = __activeIndex % wheelOfFortune.count;
76 if (interval < 700) {
76 if (interval < 700) {
77 //![3]
77 //![3]
78 wheelOfFortune.at(index).exploded = false;
78 wheelOfFortune.at(index).exploded = false;
79 __activeIndex++;
79 __activeIndex++;
80 index = __activeIndex % wheelOfFortune.count;
80 index = __activeIndex % wheelOfFortune.count;
81 wheelOfFortune.at(index).exploded = true;
81 wheelOfFortune.at(index).exploded = true;
82 //![3]
82 //![3]
83 interval = splineSeries.at(__activeIndex).y;
83 interval = splineSeries.at(__activeIndex).y;
84 //![4]
84 //![4]
85 scatterSeries.clear();
85 scatterSeries.clear();
86 scatterSeries.append(__activeIndex, interval);
86 scatterSeries.append(__activeIndex, interval);
87 scatterSeries.color = Qt.tint(scatterSeries.color, "#05FF0000");
87 scatterSeries.color = Qt.tint(scatterSeries.color, "#05FF0000");
88 scatterSeries.markerSize += 0.5;
88 scatterSeries.markerSize += 0.5;
89 //![4]
89 //![4]
90 } else {
90 } else {
91 //![5]
91 //![5]
92 // Switch the colors of the slice and the border
92 // Switch the colors of the slice and the border
93 wheelOfFortune.at(index).borderWidth = 2;
93 wheelOfFortune.at(index).borderWidth = 2;
94 var borderColor = wheelOfFortune.at(index).borderColor;
94 var borderColor = wheelOfFortune.at(index).borderColor;
95 wheelOfFortune.at(index).borderColor = wheelOfFortune.at(index).color;
95 wheelOfFortune.at(index).borderColor = wheelOfFortune.at(index).color;
96 wheelOfFortune.at(index).color = borderColor;
96 wheelOfFortune.at(index).color = borderColor;
97 //![5]
97 //![5]
98 }
98 }
99 }
99 }
100 }
100 }
101 }
101 }
@@ -1,71 +1,69
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
23
24
22
25 Flow {
23 Flow {
26 id: flow
24 id: flow
27 spacing: 5
25 spacing: 5
28 flow: Flow.TopToBottom
26 flow: Flow.TopToBottom
29 property variant series
27 property variant series
30
28
31 Button {
29 Button {
32 text: "visible"
30 text: "visible"
33 onClicked: series.visible = !series.visible;
31 onClicked: series.visible = !series.visible;
34 }
32 }
35 Button {
33 Button {
36 text: "color"
34 text: "color"
37 onClicked: series.color = main.nextColor();
35 onClicked: series.color = main.nextColor();
38 }
36 }
39 Button {
37 Button {
40 text: "borderColor"
38 text: "borderColor"
41 onClicked: series.borderColor = main.nextColor();
39 onClicked: series.borderColor = main.nextColor();
42 }
40 }
43 Button {
41 Button {
44 id: upperButton
42 id: upperButton
45 text: "upper series"
43 text: "upper series"
46 unpressedColor: "#79bd8f"
44 unpressedColor: "#79bd8f"
47 onClicked: {
45 onClicked: {
48 lineEditor.visible = true;
46 lineEditor.visible = true;
49 color = "#00a388";
47 color = "#00a388";
50 lowerButton.color = "#79bd8f";
48 lowerButton.color = "#79bd8f";
51 lineEditor.series = series.upperSeries;
49 lineEditor.series = series.upperSeries;
52 }
50 }
53 }
51 }
54 Button {
52 Button {
55 id: lowerButton
53 id: lowerButton
56 text: "lower series"
54 text: "lower series"
57 unpressedColor: "#79bd8f"
55 unpressedColor: "#79bd8f"
58 onClicked: {
56 onClicked: {
59 lineEditor.visible = true;
57 lineEditor.visible = true;
60 color = "#00a388";
58 color = "#00a388";
61 upperButton.color = "#79bd8f";
59 upperButton.color = "#79bd8f";
62 lineEditor.series = series.lowerSeries;
60 lineEditor.series = series.lowerSeries;
63 }
61 }
64 }
62 }
65 LineEditor {
63 LineEditor {
66 id: lineEditor
64 id: lineEditor
67 visible: false
65 visible: false
68 }
66 }
69
67
70 onSeriesChanged: lineEditor.series = series.upperSeries;
68 onSeriesChanged: lineEditor.series = series.upperSeries;
71 }
69 }
@@ -1,106 +1,105
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
23
22
24 Row {
23 Row {
25 anchors.fill: parent
24 anchors.fill: parent
26 spacing: 5
25 spacing: 5
27 property variant series
26 property variant series
28
27
29 Flow {
28 Flow {
30 spacing: 5
29 spacing: 5
31 flow: Flow.TopToBottom
30 flow: Flow.TopToBottom
32
31
33 Button {
32 Button {
34 text: "visible"
33 text: "visible"
35 onClicked: series.visible = !series.visible;
34 onClicked: series.visible = !series.visible;
36 }
35 }
37 Button {
36 Button {
38 text: "labels visible"
37 text: "labels visible"
39 onClicked: series.labelsVisible = !series.labelsVisible;
38 onClicked: series.labelsVisible = !series.labelsVisible;
40 }
39 }
41 Button {
40 Button {
42 text: "bar width +"
41 text: "bar width +"
43 onClicked: series.barWidth += 0.1;
42 onClicked: series.barWidth += 0.1;
44 }
43 }
45 Button {
44 Button {
46 text: "bar width -"
45 text: "bar width -"
47 onClicked: series.barWidth -= 0.1;
46 onClicked: series.barWidth -= 0.1;
48 }
47 }
49 Button {
48 Button {
50 text: "append set"
49 text: "append set"
51 onClicked: {
50 onClicked: {
52 var count = series.count;
51 var count = series.count;
53 series.append("set" + count, [0, 0.1 * count, 0.2 * count, 0.3 * count, 0.4 * count, 0.5 * count, 0.6 * count]);
52 series.append("set" + count, [0, 0.1 * count, 0.2 * count, 0.3 * count, 0.4 * count, 0.5 * count, 0.6 * count]);
54 }
53 }
55 }
54 }
56 Button {
55 Button {
57 text: "insert set"
56 text: "insert set"
58 onClicked: {
57 onClicked: {
59 var count = series.count;
58 var count = series.count;
60 series.insert(count - 1, "set" + count, [0, 0.1 * count, 0.2 * count, 0.3 * count, 0.4 * count, 0.5 * count, 0.6 * count]);
59 series.insert(count - 1, "set" + count, [0, 0.1 * count, 0.2 * count, 0.3 * count, 0.4 * count, 0.5 * count, 0.6 * count]);
61 }
60 }
62 }
61 }
63 Button {
62 Button {
64 text: "remove set"
63 text: "remove set"
65 onClicked: series.remove(series.at(series.count - 1));
64 onClicked: series.remove(series.at(series.count - 1));
66 }
65 }
67 Button {
66 Button {
68 text: "clear sets"
67 text: "clear sets"
69 onClicked: series.clear();
68 onClicked: series.clear();
70 }
69 }
71
70
72 Button {
71 Button {
73 text: "set 1 append"
72 text: "set 1 append"
74 onClicked: series.at(0).append(series.at(0).count + 1);
73 onClicked: series.at(0).append(series.at(0).count + 1);
75 }
74 }
76 Button {
75 Button {
77 text: "set 1 replace"
76 text: "set 1 replace"
78 onClicked: series.at(0).replace(series.at(0).count - 1, series.at(0).at(series.at(0).count - 1).y + 0.5);
77 onClicked: series.at(0).replace(series.at(0).count - 1, series.at(0).at(series.at(0).count - 1).y + 0.5);
79 }
78 }
80 Button {
79 Button {
81 text: "set 1 remove"
80 text: "set 1 remove"
82 onClicked: series.at(0).remove(series.at(0).count - 1);
81 onClicked: series.at(0).remove(series.at(0).count - 1);
83 }
82 }
84
83
85 Button {
84 Button {
86 text: "set 1 color"
85 text: "set 1 color"
87 onClicked: series.at(0).color = main.nextColor();
86 onClicked: series.at(0).color = main.nextColor();
88 }
87 }
89 Button {
88 Button {
90 text: "set 1 border color"
89 text: "set 1 border color"
91 onClicked: series.at(0).borderColor = main.nextColor();
90 onClicked: series.at(0).borderColor = main.nextColor();
92 }
91 }
93 Button {
92 Button {
94 text: "set 1 label color"
93 text: "set 1 label color"
95 onClicked: series.at(0).labelColor = main.nextColor();
94 onClicked: series.at(0).labelColor = main.nextColor();
96 }
95 }
97 }
96 }
98
97
99 FontEditor {
98 FontEditor {
100 id: fontEditor
99 id: fontEditor
101 fontDescription: "label"
100 fontDescription: "label"
102 function editedFont() {
101 function editedFont() {
103 return series.at(0).labelFont;
102 return series.at(0).labelFont;
104 }
103 }
105 }
104 }
106 }
105 }
@@ -1,100 +1,99
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
23
22
24 Item {
23 Item {
25 id: chartEditor
24 id: chartEditor
26 property variant series // TODO: rename to chart
25 property variant series // TODO: rename to chart
27 onSeriesChanged: loader.item.chart = series;
26 onSeriesChanged: loader.item.chart = series;
28
27
29 Flow {
28 Flow {
30 id: selectorFlow
29 id: selectorFlow
31 anchors.top: parent.top
30 anchors.top: parent.top
32 height: 60
31 height: 60
33 anchors.left: parent.left
32 anchors.left: parent.left
34 anchors.right: parent.right
33 anchors.right: parent.right
35 spacing: 5
34 spacing: 5
36 flow: Flow.TopToBottom
35 flow: Flow.TopToBottom
37
36
38 Button {
37 Button {
39 id: chartButton
38 id: chartButton
40 text: "Chart properties"
39 text: "Chart properties"
41 unpressedColor: "#79bd8f"
40 unpressedColor: "#79bd8f"
42 onClicked: {
41 onClicked: {
43 color = "#00a388";
42 color = "#00a388";
44 legendButton.color = "#79bd8f";
43 legendButton.color = "#79bd8f";
45 axisXButton.color = "#79bd8f";
44 axisXButton.color = "#79bd8f";
46 axisYButton.color = "#79bd8f";
45 axisYButton.color = "#79bd8f";
47 loader.source = "ChartEditor1.qml";
46 loader.source = "ChartEditor1.qml";
48 loader.item.chart = series;
47 loader.item.chart = series;
49 }
48 }
50 }
49 }
51 Button {
50 Button {
52 id: legendButton
51 id: legendButton
53 text: "Legend properties"
52 text: "Legend properties"
54 unpressedColor: "#79bd8f"
53 unpressedColor: "#79bd8f"
55 onClicked: {
54 onClicked: {
56 color = "#00a388";
55 color = "#00a388";
57 chartButton.color = "#79bd8f";
56 chartButton.color = "#79bd8f";
58 axisXButton.color = "#79bd8f";
57 axisXButton.color = "#79bd8f";
59 axisYButton.color = "#79bd8f";
58 axisYButton.color = "#79bd8f";
60 loader.source = "ChartEditor2.qml";
59 loader.source = "ChartEditor2.qml";
61 loader.item.chartLegend = series.legend;
60 loader.item.chartLegend = series.legend;
62 }
61 }
63 }
62 }
64 Button {
63 Button {
65 id: axisXButton
64 id: axisXButton
66 text: "Axis X properties"
65 text: "Axis X properties"
67 unpressedColor: "#79bd8f"
66 unpressedColor: "#79bd8f"
68 onClicked: {
67 onClicked: {
69 color = "#00a388";
68 color = "#00a388";
70 chartButton.color = "#79bd8f";
69 chartButton.color = "#79bd8f";
71 legendButton.color = "#79bd8f";
70 legendButton.color = "#79bd8f";
72 axisYButton.color = "#79bd8f";
71 axisYButton.color = "#79bd8f";
73 loader.source = "ChartEditor3.qml";
72 loader.source = "ChartEditor3.qml";
74 loader.item.axis = series.axisX;
73 loader.item.axis = series.axisX;
75 }
74 }
76 }
75 }
77 Button {
76 Button {
78 id: axisYButton
77 id: axisYButton
79 text: "Axis Y properties"
78 text: "Axis Y properties"
80 unpressedColor: "#79bd8f"
79 unpressedColor: "#79bd8f"
81 onClicked: {
80 onClicked: {
82 color = "#00a388";
81 color = "#00a388";
83 chartButton.color = "#79bd8f";
82 chartButton.color = "#79bd8f";
84 legendButton.color = "#79bd8f";
83 legendButton.color = "#79bd8f";
85 axisXButton.color = "#79bd8f";
84 axisXButton.color = "#79bd8f";
86 loader.source = "ChartEditor3.qml";
85 loader.source = "ChartEditor3.qml";
87 loader.item.axis = series.axisY;
86 loader.item.axis = series.axisY;
88 }
87 }
89 }
88 }
90 }
89 }
91
90
92 Loader {
91 Loader {
93 id: loader
92 id: loader
94 anchors.top: selectorFlow.bottom
93 anchors.top: selectorFlow.bottom
95 anchors.bottom: parent.bottom
94 anchors.bottom: parent.bottom
96 anchors.left: parent.left
95 anchors.left: parent.left
97 anchors.right: parent.right
96 anchors.right: parent.right
98 }
97 }
99
98
100 }
99 }
@@ -1,97 +1,96
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
23
22
24 Row {
23 Row {
25 anchors.fill: parent
24 anchors.fill: parent
26 spacing: 5
25 spacing: 5
27 property variant chart
26 property variant chart
28
27
29 Flow {
28 Flow {
30 flow: Flow.TopToBottom
29 flow: Flow.TopToBottom
31 spacing: 5
30 spacing: 5
32 Button {
31 Button {
33 text: "visible"
32 text: "visible"
34 onClicked: chart.visible = !chart.visible;
33 onClicked: chart.visible = !chart.visible;
35 }
34 }
36 Button {
35 Button {
37 text: "theme +"
36 text: "theme +"
38 onClicked: chart.theme++;
37 onClicked: chart.theme++;
39 }
38 }
40 Button {
39 Button {
41 text: "theme -"
40 text: "theme -"
42 onClicked: chart.theme--;
41 onClicked: chart.theme--;
43 }
42 }
44 Button {
43 Button {
45 text: "animation opt +"
44 text: "animation opt +"
46 onClicked: chart.animationOptions++;
45 onClicked: chart.animationOptions++;
47 }
46 }
48 Button {
47 Button {
49 text: "animation opt -"
48 text: "animation opt -"
50 onClicked: chart.animationOptions--;
49 onClicked: chart.animationOptions--;
51 }
50 }
52 Button {
51 Button {
53 text: "background color"
52 text: "background color"
54 onClicked: chart.backgroundColor = main.nextColor();
53 onClicked: chart.backgroundColor = main.nextColor();
55 }
54 }
56 Button {
55 Button {
57 text: "drop shadow enabled"
56 text: "drop shadow enabled"
58 onClicked: chart.dropShadowEnabled = !chart.dropShadowEnabled;
57 onClicked: chart.dropShadowEnabled = !chart.dropShadowEnabled;
59 }
58 }
60 Button {
59 Button {
61 text: "zoom +"
60 text: "zoom +"
62 onClicked: chart.zoom(2);
61 onClicked: chart.zoom(2);
63 }
62 }
64 Button {
63 Button {
65 text: "zoom -"
64 text: "zoom -"
66 onClicked: chart.zoom(0.5);
65 onClicked: chart.zoom(0.5);
67 }
66 }
68 Button {
67 Button {
69 text: "scroll left"
68 text: "scroll left"
70 onClicked: chart.scrollLeft(10);
69 onClicked: chart.scrollLeft(10);
71 }
70 }
72 Button {
71 Button {
73 text: "scroll right"
72 text: "scroll right"
74 onClicked: chart.scrollRight(10);
73 onClicked: chart.scrollRight(10);
75 }
74 }
76 Button {
75 Button {
77 text: "scroll up"
76 text: "scroll up"
78 onClicked: chart.scrollUp(10);
77 onClicked: chart.scrollUp(10);
79 }
78 }
80 Button {
79 Button {
81 text: "scroll down"
80 text: "scroll down"
82 onClicked: chart.scrollDown(10);
81 onClicked: chart.scrollDown(10);
83 }
82 }
84 Button {
83 Button {
85 text: "title color"
84 text: "title color"
86 onClicked: chart.titleColor = main.nextColor();
85 onClicked: chart.titleColor = main.nextColor();
87 }
86 }
88 }
87 }
89
88
90 FontEditor {
89 FontEditor {
91 id: fontEditor
90 id: fontEditor
92 fontDescription: "title"
91 fontDescription: "title"
93 function editedFont() {
92 function editedFont() {
94 return chart.titleFont;
93 return chart.titleFont;
95 }
94 }
96 }
95 }
97 }
96 }
@@ -1,77 +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
23
22
24 Row {
23 Row {
25 anchors.fill: parent
24 anchors.fill: parent
26 spacing: 5
25 spacing: 5
27 property variant chartLegend
26 property variant chartLegend
28
27
29 Flow {
28 Flow {
30 spacing: 5
29 spacing: 5
31 flow: Flow.TopToBottom
30 flow: Flow.TopToBottom
32
31
33 Button {
32 Button {
34 text: "legend visible"
33 text: "legend visible"
35 onClicked: chartLegend.visible = !chartLegend.visible;
34 onClicked: chartLegend.visible = !chartLegend.visible;
36 }
35 }
37 Button {
36 Button {
38 text: "legend bckgrd visible"
37 text: "legend bckgrd visible"
39 onClicked: chartLegend.backgroundVisible = !chartLegend.backgroundVisible;
38 onClicked: chartLegend.backgroundVisible = !chartLegend.backgroundVisible;
40 }
39 }
41 Button {
40 Button {
42 text: "legend color"
41 text: "legend color"
43 onClicked: chartLegend.color = main.nextColor();
42 onClicked: chartLegend.color = main.nextColor();
44 }
43 }
45 Button {
44 Button {
46 text: "legend border color"
45 text: "legend border color"
47 onClicked: chartLegend.borderColor = main.nextColor();
46 onClicked: chartLegend.borderColor = main.nextColor();
48 }
47 }
49 Button {
48 Button {
50 text: "legend label color"
49 text: "legend label color"
51 onClicked: chartLegend.labelColor = main.nextColor();
50 onClicked: chartLegend.labelColor = main.nextColor();
52 }
51 }
53 Button {
52 Button {
54 text: "legend top"
53 text: "legend top"
55 onClicked: chartLegend.alignment ^= Qt.AlignTop;
54 onClicked: chartLegend.alignment ^= Qt.AlignTop;
56 }
55 }
57 Button {
56 Button {
58 text: "legend bottom"
57 text: "legend bottom"
59 onClicked: chartLegend.alignment ^= Qt.AlignBottom;
58 onClicked: chartLegend.alignment ^= Qt.AlignBottom;
60 }
59 }
61 Button {
60 Button {
62 text: "legend left"
61 text: "legend left"
63 onClicked: chartLegend.alignment ^= Qt.AlignLeft;
62 onClicked: chartLegend.alignment ^= Qt.AlignLeft;
64 }
63 }
65 Button {
64 Button {
66 text: "legend right"
65 text: "legend right"
67 onClicked: chartLegend.alignment ^= Qt.AlignRight;
66 onClicked: chartLegend.alignment ^= Qt.AlignRight;
68 }
67 }
69 }
68 }
70
69
71 FontEditor {
70 FontEditor {
72 fontDescription: "legend"
71 fontDescription: "legend"
73 function editedFont() {
72 function editedFont() {
74 return chartLegend.font;
73 return chartLegend.font;
75 }
74 }
76 }
75 }
77 }
76 }
@@ -1,107 +1,106
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
23
22
24 Row {
23 Row {
25 anchors.fill: parent
24 anchors.fill: parent
26 spacing: 5
25 spacing: 5
27 property variant axis
26 property variant axis
28
27
29 Flow {
28 Flow {
30 id: flow
29 id: flow
31 spacing: 5
30 spacing: 5
32 flow: Flow.TopToBottom
31 flow: Flow.TopToBottom
33
32
34 Button {
33 Button {
35 text: "axis visible"
34 text: "axis visible"
36 onClicked: axis.visible = !axis.visible;
35 onClicked: axis.visible = !axis.visible;
37 }
36 }
38 Button {
37 Button {
39 text: "axis grid visible"
38 text: "axis grid visible"
40 onClicked: axis.gridVisible = !axis.gridVisible;
39 onClicked: axis.gridVisible = !axis.gridVisible;
41 }
40 }
42 Button {
41 Button {
43 text: "axis color"
42 text: "axis color"
44 onClicked: axis.color = main.nextColor();
43 onClicked: axis.color = main.nextColor();
45 }
44 }
46 Button {
45 Button {
47 text: "axis labels color"
46 text: "axis labels color"
48 onClicked: axis.labelsColor = main.nextColor();
47 onClicked: axis.labelsColor = main.nextColor();
49 }
48 }
50 Button {
49 Button {
51 text: "axis labels angle +"
50 text: "axis labels angle +"
52 onClicked: axis.labelsAngle += 5;
51 onClicked: axis.labelsAngle += 5;
53 }
52 }
54 Button {
53 Button {
55 text: "axis labels angle -"
54 text: "axis labels angle -"
56 onClicked: axis.labelsAngle -= 5;
55 onClicked: axis.labelsAngle -= 5;
57 }
56 }
58 Button {
57 Button {
59 text: "axis shades visible"
58 text: "axis shades visible"
60 onClicked: axis.shadesVisible = !axis.shadesVisible;
59 onClicked: axis.shadesVisible = !axis.shadesVisible;
61 }
60 }
62 Button {
61 Button {
63 text: "axis shades color"
62 text: "axis shades color"
64 onClicked: axis.shadesColor = main.nextColor();
63 onClicked: axis.shadesColor = main.nextColor();
65 }
64 }
66 Button {
65 Button {
67 text: "axis shades bcolor"
66 text: "axis shades bcolor"
68 onClicked: axis.shadesBorderColor = main.nextColor();
67 onClicked: axis.shadesBorderColor = main.nextColor();
69 }
68 }
70 Button {
69 Button {
71 text: "axis max +"
70 text: "axis max +"
72 onClicked: axis.max += 0.1;
71 onClicked: axis.max += 0.1;
73 }
72 }
74 Button {
73 Button {
75 text: "axis max -"
74 text: "axis max -"
76 onClicked: axis.max -= 0.1;
75 onClicked: axis.max -= 0.1;
77 }
76 }
78 Button {
77 Button {
79 text: "axis min +"
78 text: "axis min +"
80 onClicked: axis.min += 0.1;
79 onClicked: axis.min += 0.1;
81 }
80 }
82 Button {
81 Button {
83 text: "axis min -"
82 text: "axis min -"
84 onClicked: axis.min -= 0.1;
83 onClicked: axis.min -= 0.1;
85 }
84 }
86 Button {
85 Button {
87 text: "axis ticks count +"
86 text: "axis ticks count +"
88 onClicked: axis.ticksCount++;
87 onClicked: axis.ticksCount++;
89 }
88 }
90 Button {
89 Button {
91 text: "axis ticks count -"
90 text: "axis ticks count -"
92 onClicked: axis.ticksCount--;
91 onClicked: axis.ticksCount--;
93 }
92 }
94 Button {
93 Button {
95 text: "axis nice nmb"
94 text: "axis nice nmb"
96 onClicked: axis.niceNumbersEnabled = !axis.niceNumbersEnabled;
95 onClicked: axis.niceNumbersEnabled = !axis.niceNumbersEnabled;
97 }
96 }
98 }
97 }
99
98
100 FontEditor {
99 FontEditor {
101 id: fontEditor
100 id: fontEditor
102 fontDescription: "axis"
101 fontDescription: "axis"
103 function editedFont() {
102 function editedFont() {
104 return axis.labelsFont;
103 return axis.labelsFont;
105 }
104 }
106 }
105 }
107 }
106 }
@@ -1,93 +1,92
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
23
22
24 Flow {
23 Flow {
25 flow: Flow.TopToBottom
24 flow: Flow.TopToBottom
26 spacing: 5
25 spacing: 5
27 property string fontDescription: ""
26 property string fontDescription: ""
28
27
29 Button {
28 Button {
30 text: fontDescription + " bold"
29 text: fontDescription + " bold"
31 onClicked: editedFont().bold = !editedFont().bold;
30 onClicked: editedFont().bold = !editedFont().bold;
32 }
31 }
33 Button {
32 Button {
34 text: fontDescription + " capitalization"
33 text: fontDescription + " capitalization"
35 onClicked: editedFont().capitalization++;
34 onClicked: editedFont().capitalization++;
36 }
35 }
37 Button {
36 Button {
38 text: fontDescription + " family"
37 text: fontDescription + " family"
39 onClicked: editedFont().family = "courier";
38 onClicked: editedFont().family = "courier";
40 }
39 }
41 Button {
40 Button {
42 text: fontDescription + " font italic"
41 text: fontDescription + " font italic"
43 onClicked: editedFont().italic = !editedFont().italic;
42 onClicked: editedFont().italic = !editedFont().italic;
44 }
43 }
45 Button {
44 Button {
46 text: fontDescription + " letterSpacing +"
45 text: fontDescription + " letterSpacing +"
47 onClicked: editedFont().letterSpacing++;
46 onClicked: editedFont().letterSpacing++;
48 }
47 }
49 Button {
48 Button {
50 text: fontDescription + " letterSpacing -"
49 text: fontDescription + " letterSpacing -"
51 onClicked: editedFont().letterSpacing--;
50 onClicked: editedFont().letterSpacing--;
52 }
51 }
53 Button {
52 Button {
54 text: fontDescription + " pixelSize +"
53 text: fontDescription + " pixelSize +"
55 onClicked: editedFont().pixelSize++;
54 onClicked: editedFont().pixelSize++;
56 }
55 }
57 Button {
56 Button {
58 text: fontDescription + " pixelSize -"
57 text: fontDescription + " pixelSize -"
59 onClicked: editedFont().pixelSize--;
58 onClicked: editedFont().pixelSize--;
60 }
59 }
61 Button {
60 Button {
62 text: fontDescription + " pointSize +"
61 text: fontDescription + " pointSize +"
63 onClicked: editedFont().pointSize++;
62 onClicked: editedFont().pointSize++;
64 }
63 }
65 Button {
64 Button {
66 text: fontDescription + " pointSize -"
65 text: fontDescription + " pointSize -"
67 onClicked: editedFont().pointSize--;
66 onClicked: editedFont().pointSize--;
68 }
67 }
69 Button {
68 Button {
70 text: fontDescription + " strikeout"
69 text: fontDescription + " strikeout"
71 onClicked: editedFont().strikeout = !editedFont().strikeout;
70 onClicked: editedFont().strikeout = !editedFont().strikeout;
72 }
71 }
73 Button {
72 Button {
74 text: fontDescription + " underline"
73 text: fontDescription + " underline"
75 onClicked: editedFont().underline = !editedFont().underline;
74 onClicked: editedFont().underline = !editedFont().underline;
76 }
75 }
77 Button {
76 Button {
78 text: fontDescription + " weight +"
77 text: fontDescription + " weight +"
79 onClicked: editedFont().weight++;
78 onClicked: editedFont().weight++;
80 }
79 }
81 Button {
80 Button {
82 text: fontDescription + " weight -"
81 text: fontDescription + " weight -"
83 onClicked: editedFont().weight--;
82 onClicked: editedFont().weight--;
84 }
83 }
85 Button {
84 Button {
86 text: fontDescription + " wordSpacing +"
85 text: fontDescription + " wordSpacing +"
87 onClicked: editedFont().wordSpacing++;
86 onClicked: editedFont().wordSpacing++;
88 }
87 }
89 Button {
88 Button {
90 text: fontDescription + " wordSpacing -"
89 text: fontDescription + " wordSpacing -"
91 onClicked: editedFont().wordSpacing--;
90 onClicked: editedFont().wordSpacing--;
92 }
91 }
93 }
92 }
@@ -1,66 +1,65
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
23
22
24
23
25 Flow {
24 Flow {
26 id: flow
25 id: flow
27 spacing: 5
26 spacing: 5
28 flow: Flow.TopToBottom
27 flow: Flow.TopToBottom
29 property variant series
28 property variant series
30
29
31 Button {
30 Button {
32 text: "visible"
31 text: "visible"
33 onClicked: series.visible = !series.visible;
32 onClicked: series.visible = !series.visible;
34 }
33 }
35 Button {
34 Button {
36 text: "color"
35 text: "color"
37 onClicked: series.color = main.nextColor();
36 onClicked: series.color = main.nextColor();
38 }
37 }
39 Button {
38 Button {
40 text: "points visible"
39 text: "points visible"
41 onClicked: series.pointsVisible = !series.pointsVisible;
40 onClicked: series.pointsVisible = !series.pointsVisible;
42 }
41 }
43 Button {
42 Button {
44 text: "append point"
43 text: "append point"
45 onClicked: series.append(series.count - 1, series.count - 1);
44 onClicked: series.append(series.count - 1, series.count - 1);
46 }
45 }
47 Button {
46 Button {
48 text: "replace point"
47 text: "replace point"
49 onClicked: {
48 onClicked: {
50 var xyPoint = series.at(series.count - 1);
49 var xyPoint = series.at(series.count - 1);
51 series.replace(xyPoint.x, xyPoint.y, xyPoint.x, xyPoint.y + 0.1);
50 series.replace(xyPoint.x, xyPoint.y, xyPoint.x, xyPoint.y + 0.1);
52 }
51 }
53 }
52 }
54 Button {
53 Button {
55 text: "remove point"
54 text: "remove point"
56 onClicked: series.remove(series.at(series.count - 1).x, series.at(series.count - 1).y);
55 onClicked: series.remove(series.at(series.count - 1).x, series.at(series.count - 1).y);
57 }
56 }
58 Button {
57 Button {
59 text: "insert point"
58 text: "insert point"
60 onClicked: series.insert(series.count - 2, series.count - 2, series.count - 2);
59 onClicked: series.insert(series.count - 2, series.count - 2, series.count - 2);
61 }
60 }
62 Button {
61 Button {
63 text: "clear"
62 text: "clear"
64 onClicked: series.clear();
63 onClicked: series.clear();
65 }
64 }
66 }
65 }
@@ -1,143 +1,142
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
23
22
24 Row {
23 Row {
25 anchors.fill: parent
24 anchors.fill: parent
26 spacing: 5
25 spacing: 5
27 property variant series
26 property variant series
28
27
29 Flow {
28 Flow {
30 id: flow
29 id: flow
31 spacing: 5
30 spacing: 5
32 flow: Flow.TopToBottom
31 flow: Flow.TopToBottom
33
32
34 Button {
33 Button {
35 text: "visible"
34 text: "visible"
36 onClicked: series.visible = !series.visible;
35 onClicked: series.visible = !series.visible;
37 }
36 }
38 Button {
37 Button {
39 text: "series hpos +"
38 text: "series hpos +"
40 onClicked: series.horizontalPosition += 0.1;
39 onClicked: series.horizontalPosition += 0.1;
41 }
40 }
42 Button {
41 Button {
43 text: "series hpos -"
42 text: "series hpos -"
44 onClicked: series.horizontalPosition -= 0.1;
43 onClicked: series.horizontalPosition -= 0.1;
45 }
44 }
46 Button {
45 Button {
47 text: "series vpos +"
46 text: "series vpos +"
48 onClicked: series.verticalPosition += 0.1;
47 onClicked: series.verticalPosition += 0.1;
49 }
48 }
50 Button {
49 Button {
51 text: "series vpos -"
50 text: "series vpos -"
52 onClicked: series.verticalPosition -= 0.1;
51 onClicked: series.verticalPosition -= 0.1;
53 }
52 }
54 Button {
53 Button {
55 text: "series size +"
54 text: "series size +"
56 onClicked: series.size += 0.1;
55 onClicked: series.size += 0.1;
57 }
56 }
58 Button {
57 Button {
59 text: "series size -"
58 text: "series size -"
60 onClicked: series.size -= 0.1;
59 onClicked: series.size -= 0.1;
61 }
60 }
62 Button {
61 Button {
63 text: "series start angle +"
62 text: "series start angle +"
64 onClicked: series.startAngle += 1.1;
63 onClicked: series.startAngle += 1.1;
65 }
64 }
66 Button {
65 Button {
67 text: "series start angle -"
66 text: "series start angle -"
68 onClicked: series.startAngle -= 1.1;
67 onClicked: series.startAngle -= 1.1;
69 }
68 }
70 Button {
69 Button {
71 text: "series end angle +"
70 text: "series end angle +"
72 onClicked: series.endAngle += 1.1;
71 onClicked: series.endAngle += 1.1;
73 }
72 }
74 Button {
73 Button {
75 text: "series end angle -"
74 text: "series end angle -"
76 onClicked: series.endAngle -= 1.1;
75 onClicked: series.endAngle -= 1.1;
77 }
76 }
78 Button {
77 Button {
79 text: "remove slice"
78 text: "remove slice"
80 onClicked: series.remove(series.at(series.count - 1));
79 onClicked: series.remove(series.at(series.count - 1));
81 }
80 }
82 Button {
81 Button {
83 text: "slice color"
82 text: "slice color"
84 onClicked: series.at(0).color = main.nextColor();
83 onClicked: series.at(0).color = main.nextColor();
85 }
84 }
86 Button {
85 Button {
87 text: "slice border color"
86 text: "slice border color"
88 onClicked: series.at(0).borderColor = main.nextColor();
87 onClicked: series.at(0).borderColor = main.nextColor();
89 }
88 }
90 Button {
89 Button {
91 text: "slice border width +"
90 text: "slice border width +"
92 onClicked: series.at(0).borderWidth++;
91 onClicked: series.at(0).borderWidth++;
93 }
92 }
94 Button {
93 Button {
95 text: "slice border width -"
94 text: "slice border width -"
96 onClicked: series.at(0).borderWidth--;
95 onClicked: series.at(0).borderWidth--;
97 }
96 }
98 Button {
97 Button {
99 text: "slice label visible"
98 text: "slice label visible"
100 onClicked: series.at(0).labelVisible = !series.at(0).labelVisible;
99 onClicked: series.at(0).labelVisible = !series.at(0).labelVisible;
101 }
100 }
102 Button {
101 Button {
103 text: "slice label position inside"
102 text: "slice label position inside"
104 onClicked: series.at(0).labelPosition = PieSlice.LabelInside;
103 onClicked: series.at(0).labelPosition = PieSlice.LabelInside;
105 }
104 }
106 Button {
105 Button {
107 text: "slice label position outside"
106 text: "slice label position outside"
108 onClicked: series.at(0).labelPosition = PieSlice.LabelOutside;
107 onClicked: series.at(0).labelPosition = PieSlice.LabelOutside;
109 }
108 }
110 Button {
109 Button {
111 text: "slice label arm len +"
110 text: "slice label arm len +"
112 onClicked: series.at(0).labelArmLengthFactor += 0.1;
111 onClicked: series.at(0).labelArmLengthFactor += 0.1;
113 }
112 }
114 Button {
113 Button {
115 text: "slice label arm len -"
114 text: "slice label arm len -"
116 onClicked: series.at(0).labelArmLengthFactor -= 0.1;
115 onClicked: series.at(0).labelArmLengthFactor -= 0.1;
117 }
116 }
118 Button {
117 Button {
119 text: "slice label color"
118 text: "slice label color"
120 onClicked: series.at(0).labelColor = main.nextColor();
119 onClicked: series.at(0).labelColor = main.nextColor();
121 }
120 }
122 Button {
121 Button {
123 text: "slice exploded"
122 text: "slice exploded"
124 onClicked: series.at(0).exploded = !series.at(0).exploded;
123 onClicked: series.at(0).exploded = !series.at(0).exploded;
125 }
124 }
126 Button {
125 Button {
127 text: "slice explode dist +"
126 text: "slice explode dist +"
128 onClicked: series.at(0).explodeDistanceFactor += 0.1;
127 onClicked: series.at(0).explodeDistanceFactor += 0.1;
129 }
128 }
130 Button {
129 Button {
131 text: "slice explode dist -"
130 text: "slice explode dist -"
132 onClicked: series.at(0).explodeDistanceFactor -= 0.1;
131 onClicked: series.at(0).explodeDistanceFactor -= 0.1;
133 }
132 }
134 }
133 }
135
134
136 FontEditor {
135 FontEditor {
137 id: fontEditor
136 id: fontEditor
138 fontDescription: "label"
137 fontDescription: "label"
139 function editedFont() {
138 function editedFont() {
140 return series.at(0).labelFont;
139 return series.at(0).labelFont;
141 }
140 }
142 }
141 }
143 }
142 }
@@ -1,78 +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
23
24
22
25 Flow {
23 Flow {
26 id: flow
24 id: flow
27 spacing: 5
25 spacing: 5
28 flow: Flow.TopToBottom
26 flow: Flow.TopToBottom
29 property variant series
27 property variant series
30
28
31 Button {
29 Button {
32 text: "visible"
30 text: "visible"
33 onClicked: series.visible = !series.visible;
31 onClicked: series.visible = !series.visible;
34 }
32 }
35 Button {
33 Button {
36 text: "color"
34 text: "color"
37 onClicked: series.color = main.nextColor();
35 onClicked: series.color = main.nextColor();
38 }
36 }
39 Button {
37 Button {
40 text: "borderColor"
38 text: "borderColor"
41 onClicked: series.borderColor = main.nextColor();
39 onClicked: series.borderColor = main.nextColor();
42 }
40 }
43 Button {
41 Button {
44 text: "markerSize +"
42 text: "markerSize +"
45 onClicked: series.markerSize += 1.0;
43 onClicked: series.markerSize += 1.0;
46 }
44 }
47 Button {
45 Button {
48 text: "markerSize -"
46 text: "markerSize -"
49 onClicked: series.markerSize -= 1.0;
47 onClicked: series.markerSize -= 1.0;
50 }
48 }
51 Button {
49 Button {
52 text: "markerShape"
50 text: "markerShape"
53 onClicked: series.markerShape = ((series.markerShape + 1) % 2);
51 onClicked: series.markerShape = ((series.markerShape + 1) % 2);
54 }
52 }
55 Button {
53 Button {
56 text: "append point"
54 text: "append point"
57 onClicked: series.append(series.count - 1, series.count - 1);
55 onClicked: series.append(series.count - 1, series.count - 1);
58 }
56 }
59 Button {
57 Button {
60 text: "replace point"
58 text: "replace point"
61 onClicked: {
59 onClicked: {
62 var xyPoint = series.at(series.count - 1);
60 var xyPoint = series.at(series.count - 1);
63 series.replace(xyPoint.x, xyPoint.y, xyPoint.x, xyPoint.y + 0.1);
61 series.replace(xyPoint.x, xyPoint.y, xyPoint.x, xyPoint.y + 0.1);
64 }
62 }
65 }
63 }
66 Button {
64 Button {
67 text: "remove point"
65 text: "remove point"
68 onClicked: series.remove(series.at(series.count - 1).x, series.at(series.count - 1).y);
66 onClicked: series.remove(series.at(series.count - 1).x, series.at(series.count - 1).y);
69 }
67 }
70 Button {
68 Button {
71 text: "insert point"
69 text: "insert point"
72 onClicked: series.insert(series.count - 2, series.count - 2, series.count - 2);
70 onClicked: series.insert(series.count - 2, series.count - 2, series.count - 2);
73 }
71 }
74 Button {
72 Button {
75 text: "clear"
73 text: "clear"
76 onClicked: series.clear();
74 onClicked: series.clear();
77 }
75 }
78 }
76 }
@@ -1,122 +1,121
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
23
22
24 Rectangle {
23 Rectangle {
25 id: main
24 id: main
26 width: parent.width
25 width: parent.width
27 height: parent.height
26 height: parent.height
28 property int viewNumber: 0
27 property int viewNumber: 0
29 property int viewCount: 9
28 property int viewCount: 9
30 property variant colors: ["#637D74", "#403D3A", "#8C3B3B", "#AB6937", "#D4A960"]
29 property variant colors: ["#637D74", "#403D3A", "#8C3B3B", "#AB6937", "#D4A960"]
31 property int colorIndex: 0
30 property int colorIndex: 0
32
31
33 function nextColor() {
32 function nextColor() {
34 colorIndex++;
33 colorIndex++;
35 return colors[colorIndex % colors.length];
34 return colors[colorIndex % colors.length];
36 }
35 }
37
36
38 onViewNumberChanged: {
37 onViewNumberChanged: {
39 if (viewNumber == 0) {
38 if (viewNumber == 0) {
40 chartLoader.source = "Chart.qml";
39 chartLoader.source = "Chart.qml";
41 editorLoader.source = "ChartEditor.qml";
40 editorLoader.source = "ChartEditor.qml";
42 } else if (viewNumber == 1) {
41 } else if (viewNumber == 1) {
43 chartLoader.source = "PieChart.qml";
42 chartLoader.source = "PieChart.qml";
44 editorLoader.source = "PieEditor.qml";
43 editorLoader.source = "PieEditor.qml";
45 } else if (viewNumber == 2) {
44 } else if (viewNumber == 2) {
46 chartLoader.source = "LineChart.qml";
45 chartLoader.source = "LineChart.qml";
47 editorLoader.source = "LineEditor.qml";
46 editorLoader.source = "LineEditor.qml";
48 } else if (viewNumber == 3) {
47 } else if (viewNumber == 3) {
49 chartLoader.source = "SplineChart.qml";
48 chartLoader.source = "SplineChart.qml";
50 editorLoader.source = "LineEditor.qml";
49 editorLoader.source = "LineEditor.qml";
51 } else if (viewNumber == 4) {
50 } else if (viewNumber == 4) {
52 chartLoader.source = "ScatterChart.qml";
51 chartLoader.source = "ScatterChart.qml";
53 editorLoader.source = "ScatterEditor.qml";
52 editorLoader.source = "ScatterEditor.qml";
54 } else if (viewNumber == 5) {
53 } else if (viewNumber == 5) {
55 chartLoader.source = "AreaChart.qml";
54 chartLoader.source = "AreaChart.qml";
56 editorLoader.source = "AreaEditor.qml";
55 editorLoader.source = "AreaEditor.qml";
57 } else if (viewNumber == 6) {
56 } else if (viewNumber == 6) {
58 chartLoader.source = "BarChart.qml";
57 chartLoader.source = "BarChart.qml";
59 editorLoader.source = "BarEditor.qml";
58 editorLoader.source = "BarEditor.qml";
60 } else if (viewNumber == 7) {
59 } else if (viewNumber == 7) {
61 chartLoader.source = "StackedBarChart.qml";
60 chartLoader.source = "StackedBarChart.qml";
62 editorLoader.source = "BarEditor.qml";
61 editorLoader.source = "BarEditor.qml";
63 } else if (viewNumber == 8) {
62 } else if (viewNumber == 8) {
64 chartLoader.source = "PercentBarChart.qml";
63 chartLoader.source = "PercentBarChart.qml";
65 editorLoader.source = "BarEditor.qml";
64 editorLoader.source = "BarEditor.qml";
66 } else {
65 } else {
67 console.log("Illegal view number");
66 console.log("Illegal view number");
68 }
67 }
69 }
68 }
70
69
71 Row {
70 Row {
72 anchors.top: parent.top
71 anchors.top: parent.top
73 anchors.bottom: buttonRow.top
72 anchors.bottom: buttonRow.top
74 anchors.bottomMargin: 10
73 anchors.bottomMargin: 10
75 anchors.left: parent.left
74 anchors.left: parent.left
76 anchors.right: parent.right
75 anchors.right: parent.right
77
76
78 Loader {
77 Loader {
79 id: chartLoader
78 id: chartLoader
80 width: main.width - editorLoader.width
79 width: main.width - editorLoader.width
81 height: parent.height
80 height: parent.height
82 source: "Chart.qml"
81 source: "Chart.qml"
83 onStatusChanged: {
82 onStatusChanged: {
84 if (status == Loader.Ready && editorLoader.status == Loader.Ready && chartLoader.item)
83 if (status == Loader.Ready && editorLoader.status == Loader.Ready && chartLoader.item)
85 editorLoader.item.series = chartLoader.item.series;
84 editorLoader.item.series = chartLoader.item.series;
86 }
85 }
87 }
86 }
88
87
89 Loader {
88 Loader {
90 id: editorLoader
89 id: editorLoader
91 width: 280
90 width: 280
92 height: parent.height
91 height: parent.height
93 source: "ChartEditor.qml"
92 source: "ChartEditor.qml"
94 onStatusChanged: {
93 onStatusChanged: {
95 if (status == Loader.Ready && chartLoader.status == Loader.Ready && chartLoader.item)
94 if (status == Loader.Ready && chartLoader.status == Loader.Ready && chartLoader.item)
96 editorLoader.item.series = chartLoader.item.series;
95 editorLoader.item.series = chartLoader.item.series;
97 }
96 }
98 }
97 }
99 }
98 }
100
99
101 Row {
100 Row {
102 id: buttonRow
101 id: buttonRow
103 height: 40
102 height: 40
104 anchors.bottom: parent.bottom
103 anchors.bottom: parent.bottom
105 anchors.horizontalCenter: parent.horizontalCenter
104 anchors.horizontalCenter: parent.horizontalCenter
106 spacing: 10
105 spacing: 10
107
106
108 Button {
107 Button {
109 text: "previous"
108 text: "previous"
110 onClicked: {
109 onClicked: {
111 viewNumber = (viewNumber + viewCount - 1) % viewCount;
110 viewNumber = (viewNumber + viewCount - 1) % viewCount;
112 }
111 }
113 }
112 }
114
113
115 Button {
114 Button {
116 text: "next"
115 text: "next"
117 onClicked: {
116 onClicked: {
118 viewNumber = (viewNumber + 1) % viewCount;
117 viewNumber = (viewNumber + 1) % viewCount;
119 }
118 }
120 }
119 }
121 }
120 }
122 }
121 }
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now