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