##// END OF EJS Templates
Fixes qmlchartproperties
Michal Klocek -
r1606:ebf4c2a781ad
parent child
Show More
@@ -1,75 +1,75
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 22 import QtCommercial.Chart 1.0
23 23
24 24 ChartView {
25 25 title: "area series"
26 26 anchors.fill: parent
27 27
28 28 property variant series: areaSeries
29 29
30 30 AreaSeries {
31 31 id: areaSeries
32 32 name: "area 1"
33 axisX: CategoriesAxis {
34 id: categoriesAxis
35 categories: ["2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007",
36 "2008", "2009", "2010", "2011" ]
37 }
33
38 34 upperSeries: LineSeries {
39 35 XYPoint { x: 0; y: 1 }
40 36 XYPoint { x: 1; y: 1 }
41 37 XYPoint { x: 2; y: 3 }
42 38 XYPoint { x: 3; y: 3 }
43 39 XYPoint { x: 4; y: 2 }
44 40 XYPoint { x: 5; y: 0 }
45 41 XYPoint { x: 6; y: 2 }
46 42 XYPoint { x: 7; y: 1 }
47 43 XYPoint { x: 8; y: 2 }
48 44 XYPoint { x: 9; y: 1 }
49 45 XYPoint { x: 10; y: 3 }
50 46 XYPoint { x: 11; y: 3 }
51 47 }
52 48 lowerSeries: LineSeries {
53 49 XYPoint { x: 0; y: 0 }
54 50 XYPoint { x: 1; y: 0 }
55 51 XYPoint { x: 2; y: 0 }
56 52 XYPoint { x: 3; y: 0 }
57 53 XYPoint { x: 4; y: 0 }
58 54 XYPoint { x: 5; y: 0 }
59 55 XYPoint { x: 6; y: 0 }
60 56 XYPoint { x: 7; y: 0 }
61 57 XYPoint { x: 8; y: 0 }
62 58 XYPoint { x: 9; y: 0 }
63 59 XYPoint { x: 10; y: 0 }
64 60 XYPoint { x: 11; y: 0 }
65 61 }
66 62
67 63 onNameChanged: console.log("areaSeries.onNameChanged: " + name);
68 64 onVisibleChanged: console.log("areaSeries.onVisibleChanged: " + visible);
69 65 onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y);
70 66 onSelected: console.log("areaSeries.onSelected");
71 67 onColorChanged: console.log("areaSeries.onColorChanged: " + color);
72 68 onBorderColorChanged: console.log("areaSeries.onBorderColorChanged: " + borderColor);
73 69 // onCountChanged: console.log("areaSeries.onCountChanged: " + count);
70
71 Component.onCompleted: {
72 createDefaultAxes();
73 }
74 74 }
75 75 }
@@ -1,66 +1,72
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 22 import QtCommercial.Chart 1.0
23 23
24 24 ChartView {
25 title: "Bar series"
25 title: "Grouped bar series"
26 26 anchors.fill: parent
27 27 theme: ChartView.ChartThemeLight
28 28 legend.alignment: Qt.AlignBottom
29 29
30 property variant series: barSeries
30 property variant series: mySeries
31
32 CategoriesAxis {
33 id:myAxis;
34 categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] }
31 35
32 36 BarSeries {
33 id: barSeries
37 id: mySeries
34 38 name: "bar"
35 axisX: CategoriesAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] }
36 BarSet { label: "Bob"; values: [4, 7, 3, 10, 5, 6]
39
40 BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6]
37 41 onClicked: console.log("barset.onClicked: " + index);
38 42 onHovered: console.log("barset.onHovered: " + status);
39 43 onPenChanged: console.log("barset.onPenChanged: " + pen);
40 44 onBrushChanged: console.log("barset.onBrushChanged: " + brush);
41 45 onLabelChanged: console.log("barset.onLabelChanged: " + label);
42 46 onLabelBrushChanged: console.log("barset.onLabelBrushChanged: " + labelBrush);
43 47 onLabelFontChanged: console.log("barset.onLabelFontChanged: " + labelFont);
44 48 onColorChanged: console.log("barset.onColorChanged: " + color);
45 49 onBorderColorChanged: console.log("barset.onBorderColorChanged: " + color);
46 50 onLabelColorChanged: console.log("barset.onLabelColorChanged: " + color);
47 51 onCountChanged: console.log("barset.onCountChanged: " + count);
48 52 onValuesAdded: console.log("barset.onValuesAdded: " + index + ", " + count);
49 53 onValuesRemoved: console.log("barset.onValuesRemoved: " + index + ", " + count);
50 54 onValueChanged: console.log("barset.onValuesChanged: " + index);
51 55 }
52 BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 8] }
53 BarSet { label: "James"; values: [3, 5, 8, 5, 4, 7] }
56 BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] }
57 BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] }
54 58
55 onNameChanged: console.log("barSeries.onNameChanged: " + series.name);
56 onVisibleChanged: console.log("barSeries.onVisibleChanged: " + series.visible);
57 onClicked: console.log("barSeries.onClicked: " + barset + " " + index);
58 onHovered: console.log("barSeries.onHovered: " + barset + " " + status);
59 onLabelsVisibleChanged: console.log("barSeries.onLabelsVisibleChanged: " + series.labelsVisible);
60 onCountChanged: console.log("barSeries.onCountChanged: " + count);
61 onBarsetsAdded: console.log("barSeries.onBarsetsAdded: " + sets); // There is no point in this signal on QML side
62 onAdded: console.log("barSeries.onBarsetAdded: " + barset);
63 onBarsetsRemoved: console.log("barSeries.onBarsetsRemoved: " + sets); // There is no point in this signal on QML side
64 onRemoved: console.log("barSeries.onBarsetRemoved: " + barset);
59 onNameChanged: console.log("groupedBarSeries.onNameChanged: " + series.name);
60 onVisibleChanged: console.log("groupedBarSeries.onVisibleChanged: " + series.visible);
61 onClicked: console.log("groupedBarSeries.onClicked: " + barset + " " + index);
62 onHovered: console.log("groupedBarSeries.onHovered: " + barset + " " + status);
63 onLabelsVisibleChanged: console.log("groupedBarSeries.onLabelsVisibleChanged: " + series.labelsVisible);
64 onCountChanged: console.log("groupedBarSeries.onCountChanged: " + count);
65 }
66
67 Component.onCompleted: {
68 createDefaultAxes();
69 setAxisX(myAxis,mySeries);
65 70 }
66 }
71
72 } No newline at end of file
@@ -1,106 +1,114
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 22 import QtCommercial.Chart 1.0
23 23
24 24 ChartView {
25 25 id: chartView
26 26 title: "Chart Title"
27 27 anchors.fill: parent
28 28 property variant series: chartView
29 29
30 30 LineSeries {
31 31 name: "line"
32 32 XYPoint { x: 0; y: 0 }
33 33 XYPoint { x: 1.1; y: 2.1 }
34 34 XYPoint { x: 1.9; y: 3.3 }
35 35 XYPoint { x: 2.1; y: 2.1 }
36 36 XYPoint { x: 2.9; y: 4.9 }
37 37 XYPoint { x: 3.4; y: 3.0 }
38 38 XYPoint { x: 4.1; y: 3.3 }
39 39 }
40 40
41 41 onVisibleChanged: console.log("chart.onVisibleChanged: " + visible);
42 42 onTitleColorChanged: console.log("chart.onTitleColorChanged: " + color);
43 43 onBackgroundColorChanged: console.log("chart.onBackgroundColorChanged: " + series.backgroundColor);
44 44 onDropShadowEnabledChanged: console.log("chart.onDropShadowEnabledChanged: " + enabled);
45 45 onTopMarginChanged: {
46 46 console.log("chart.onTopMarginChanged: " + margin);
47 47 marginVisualizer.opacity = 1.0;
48 48 }
49 49 onBottomMarginChanged: {
50 50 console.log("chart.onBottomMarginChanged: " + margin);
51 51 marginVisualizer.opacity = 1.0;
52 52 }
53 53 onLeftMarginChanged: {
54 54 console.log("chart.onLeftMarginChanged: " + margin);
55 55 marginVisualizer.opacity = 1.0;
56 56 }
57 57 onRightMarginChanged: {
58 58 console.log("chart.onRightMarginChanged: " + margin);
59 59 marginVisualizer.opacity = 1.0;
60 60 }
61 61
62 62 legend.onVisibleChanged: console.log("legend.onVisibleChanged: " + series.legend.visible);
63 63 legend.onBackgroundVisibleChanged: console.log("legend.onBackgroundVisibleChanged: " + visible);
64 64 legend.onColorChanged: console.log("legend.onColorChanged: " + color);
65 65 legend.onBorderColorChanged: console.log("legend.onBorderColorChanged: " + color);
66 66 legend.onLabelColorChanged: console.log("legend.onLabelColorChanged: " + color);
67 67
68 axisX.onColorChanged: console.log("axisX.onColorChanged: " + color);
69 axisX.onLabelsVisibleChanged: console.log("axisX.onLabelsVisibleChanged: " + visible);
70 axisX.onLabelsColorChanged: console.log("axisX.onLabelsColorChanged: " + color);
71 axisX.onVisibleChanged: console.log("axisX.onVisibleChanged: " + visible);
72 axisX.onGridVisibleChanged: console.log("axisX.onGridVisibleChanged: " + visible);
73 axisX.onShadesVisibleChanged: console.log("axisX.onShadesVisibleChanged: " + visible);
74 axisX.onShadesColorChanged: console.log("axisX.onShadesColorChanged: " + color);
75 axisX.onShadesBorderColorChanged: console.log("axisX.onShadesBorderColorChanged: " + color);
76 axisX.onMinChanged: console.log("axisX.onMinChanged: " + min);
77 axisX.onMaxChanged: console.log("axisX.onMaxChanged: " + max);
78
79 axisY.onColorChanged: console.log("axisY.onColorChanged: " + color);
80 axisY.onLabelsVisibleChanged: console.log("axisY.onLabelsVisibleChanged: " + visible);
81 axisY.onLabelsColorChanged: console.log("axisY.onLabelsColorChanged: " + color);
82 axisY.onVisibleChanged: console.log("axisY.onVisibleChanged: " + visible);
83 axisY.onGridVisibleChanged: console.log("axisY.onGridVisibleChanged: " + visible);
84 axisY.onShadesVisibleChanged: console.log("axisY.onShadesVisibleChanged: " + visible);
85 axisY.onShadesColorChanged: console.log("axisY.onShadesColorChanged: " + color);
86 axisY.onShadesBorderColorChanged: console.log("axisY.onShadesBorderColorChanged: " + color);
87 axisY.onMinChanged: console.log("axisY.onMinChanged: " + min);
88 axisY.onMaxChanged: console.log("axisY.onMaxChanged: " + max);
89 68
69 ValuesAxis{
70 onColorChanged: console.log("axisX.onColorChanged: " + color);
71 onLabelsVisibleChanged: console.log("axisX.onLabelsVisibleChanged: " + visible);
72 onLabelsColorChanged: console.log("axisX.onLabelsColorChanged: " + color);
73 onVisibleChanged: console.log("axisX.onVisibleChanged: " + visible);
74 onGridVisibleChanged: console.log("axisX.onGridVisibleChanged: " + visible);
75 onShadesVisibleChanged: console.log("axisX.onShadesVisibleChanged: " + visible);
76 onShadesColorChanged: console.log("axisX.onShadesColorChanged: " + color);
77 onShadesBorderColorChanged: console.log("axisX.onShadesBorderColorChanged: " + color);
78 onMinChanged: console.log("axisX.onMinChanged: " + min);
79 onMaxChanged: console.log("axisX.onMaxChanged: " + max);
80 }
81
82 ValuesAxis{
83 onColorChanged: console.log("axisY.onColorChanged: " + color);
84 onLabelsVisibleChanged: console.log("axisY.onLabelsVisibleChanged: " + visible);
85 onLabelsColorChanged: console.log("axisY.onLabelsColorChanged: " + color);
86 onVisibleChanged: console.log("axisY.onVisibleChanged: " + visible);
87 onGridVisibleChanged: console.log("axisY.onGridVisibleChanged: " + visible);
88 onShadesVisibleChanged: console.log("axisY.onShadesVisibleChanged: " + visible);
89 onShadesColorChanged: console.log("axisY.onShadesColorChanged: " + color);
90 onShadesBorderColorChanged: console.log("axisY.onShadesBorderColorChanged: " + color);
91 onMinChanged: console.log("axisY.onMinChanged: " + min);
92 onMaxChanged: console.log("axisY.onMaxChanged: " + max);
93 }
90 94
91 95 Rectangle {
92 96 id: marginVisualizer
93 97 color: "transparent"
94 98 border.color: "red"
95 99 anchors.fill: parent
96 100 anchors.topMargin: parent.topMargin
97 101 anchors.bottomMargin: parent.bottomMargin
98 102 anchors.leftMargin: parent.leftMargin
99 103 anchors.rightMargin: parent.rightMargin
100 104 opacity: 0.0
101 105 onOpacityChanged: if (opacity > 0.9) opacity = 0.0;
102 106 Behavior on opacity {
103 107 NumberAnimation { duration: 800 }
104 108 }
105 109 }
110
111 Component.onCompleted: {
112 createDefaultAxes();
113 }
106 114 }
@@ -1,61 +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 22 import QtCommercial.Chart 1.0
23 23
24 24 ChartView {
25 25 property variant series: lineSeries
26 26
27 27 title: "line series"
28 28 anchors.fill: parent
29 29
30 30 LineSeries {
31 31 id: lineSeries
32 32 name: "line 1"
33 33 XYPoint { x: 0; y: 0 }
34 34 XYPoint { x: 1.1; y: 2.1 }
35 35 XYPoint { x: 1.9; y: 3.3 }
36 36 XYPoint { x: 2.1; y: 2.1 }
37 37 XYPoint { x: 2.9; y: 4.9 }
38 38 XYPoint { x: 3.4; y: 3.0 }
39 39 XYPoint { x: 4.1; y: 3.3 }
40 40
41 41 onNameChanged: console.log("lineSeries.onNameChanged: " + name);
42 42 onVisibleChanged: console.log("lineSeries.onVisibleChanged: " + visible);
43 43 onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y);
44 44 onPointReplaced: console.log("lineSeries.onPointReplaced: " + index);
45 45 onPointRemoved: console.log("lineSeries.onPointRemoved: " + index);
46 46 onPointAdded: console.log("lineSeries.onPointAdded: " + series.at(index).x + ", " + series.at(index).y);
47 47 onColorChanged: console.log("lineSeries.onColorChanged: " + color);
48 48 onCountChanged: console.log("lineSeries.onCountChanged: " + count);
49 49 }
50 50
51 51 LineSeries {
52 52 name: "line 2"
53 53 XYPoint { x: 1.1; y: 1.1 }
54 54 XYPoint { x: 1.9; y: 2.3 }
55 55 XYPoint { x: 2.1; y: 1.1 }
56 56 XYPoint { x: 2.9; y: 3.9 }
57 57 XYPoint { x: 3.4; y: 2.0 }
58 58 XYPoint { x: 4.1; y: 2.3 }
59 59 onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y);
60 60 }
61
62 Component.onCompleted: {
63 createDefaultAxes();
64 }
61 65 }
@@ -1,62 +1,71
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 22 import QtCommercial.Chart 1.0
23 23
24 24 ChartView {
25 25 title: "Percent bar series"
26 26 anchors.fill: parent
27 27 theme: ChartView.ChartThemeLight
28 28 legend.alignment: Qt.AlignBottom
29 29
30 property variant series: barSeries
30 property variant series: mySeries
31
32 CategoriesAxis {
33 id: myAxis
34 categories: ["2007", "2008", "2009", "2010", "2011", "2012" ]
35 }
31 36
32 37 PercentBarSeries {
33 id: barSeries
38 id: mySeries
34 39 name: "bar"
35 axisX: CategoriesAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] }
36 40 BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6]
37 41 onClicked: console.log("barset.onClicked: " + index);
38 42 onHovered: console.log("barset.onHovered: " + status);
39 43 onPenChanged: console.log("barset.onPenChanged: " + pen);
40 44 onBrushChanged: console.log("barset.onBrushChanged: " + brush);
41 45 onLabelChanged: console.log("barset.onLabelChanged: " + label);
42 46 onLabelBrushChanged: console.log("barset.onLabelBrushChanged: " + labelBrush);
43 47 onLabelFontChanged: console.log("barset.onLabelFontChanged: " + labelFont);
44 48 onColorChanged: console.log("barset.onColorChanged: " + color);
45 49 onBorderColorChanged: console.log("barset.onBorderColorChanged: " + color);
46 50 onLabelColorChanged: console.log("barset.onLabelColorChanged: " + color);
47 51 onCountChanged: console.log("barset.onCountChanged: " + count);
48 52 onValuesAdded: console.log("barset.onValuesAdded: " + index + ", " + count);
49 53 onValuesRemoved: console.log("barset.onValuesRemoved: " + index + ", " + count);
50 54 onValueChanged: console.log("barset.onValuesChanged: " + index);
51 55 }
52 56 BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] }
53 57 BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] }
54 58
55 59 onNameChanged: console.log("percentBarSeries.onNameChanged: " + series.name);
56 60 onVisibleChanged: console.log("percentBarSeries.onVisibleChanged: " + series.visible);
57 61 onClicked: console.log("percentBarSeries.onClicked: " + barset + " " + index);
58 62 onHovered: console.log("percentBarSeries.onHovered: " + barset + " " + status);
59 63 onLabelsVisibleChanged: console.log("percentBarSeries.onLabelsVisibleChanged: " + series.labelsVisible);
60 64 onCountChanged: console.log("percentBarSeries.onCountChanged: " + count);
61 65 }
66
67 Component.onCompleted: {
68 createDefaultAxes();
69 setAxisX(myAxis,mySeries);
70 }
62 71 }
@@ -1,60 +1,64
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 22 import QtCommercial.Chart 1.0
23 23
24 24 ChartView {
25 25 title: "scatter series"
26 26 property variant series: scatterSeries
27 27
28 28 ScatterSeries {
29 29 id: scatterSeries
30 30 name: "scatter 1"
31 31 XYPoint { x: 1.5; y: 1.5 }
32 32 XYPoint { x: 1.5; y: 1.6 }
33 33 XYPoint { x: 1.57; y: 1.55 }
34 34 XYPoint { x: 1.8; y: 1.8 }
35 35 XYPoint { x: 1.9; y: 1.6 }
36 36 XYPoint { x: 2.1; y: 1.3 }
37 37 XYPoint { x: 2.5; y: 2.1 }
38 38
39 39 onNameChanged: console.log("scatterSeries.onNameChanged: " + name);
40 40 onVisibleChanged: console.log("scatterSeries.onVisibleChanged: " + visible);
41 41 onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y);
42 42 onPointReplaced: console.log("scatterSeries.onPointReplaced: " + index);
43 43 onPointRemoved: console.log("scatterSeries.onPointRemoved: " + index);
44 44 onPointAdded: console.log("scatterSeries.onPointAdded: " + series.at(index).x + ", " + series.at(index).y);
45 45 onColorChanged: console.log("scatterSeries.onColorChanged: " + color);
46 46 onBorderColorChanged: console.log("scatterSeries.onBorderColorChanged: " + borderColor);
47 47 onCountChanged: console.log("scatterSeries.onCountChanged: " + count);
48 48 }
49 49
50 50 ScatterSeries {
51 51 name: "scatter2"
52 52 XYPoint { x: 2.0; y: 2.0 }
53 53 XYPoint { x: 2.0; y: 2.1 }
54 54 XYPoint { x: 2.07; y: 2.05 }
55 55 XYPoint { x: 2.2; y: 2.9 }
56 56 XYPoint { x: 2.4; y: 2.7 }
57 57 XYPoint { x: 2.67; y: 2.65 }
58 58 onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y);
59 59 }
60
61 Component.onCompleted: {
62 createDefaultAxes();
63 }
60 64 }
@@ -1,60 +1,64
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 22 import QtCommercial.Chart 1.0
23 23
24 24 ChartView {
25 25 title: "spline series"
26 26 anchors.fill: parent
27 27 property variant series: splineSeries
28 28
29 29 SplineSeries {
30 30 id: splineSeries
31 31 name: "spline 1"
32 32 XYPoint { x: 0; y: 0 }
33 33 XYPoint { x: 1.1; y: 2.1 }
34 34 XYPoint { x: 1.9; y: 3.3 }
35 35 XYPoint { x: 2.1; y: 2.1 }
36 36 XYPoint { x: 2.9; y: 4.9 }
37 37 XYPoint { x: 3.4; y: 3.0 }
38 38 XYPoint { x: 4.1; y: 3.3 }
39 39
40 40 onNameChanged: console.log("splineSeries.onNameChanged: " + name);
41 41 onVisibleChanged: console.log("splineSeries.onVisibleChanged: " + visible);
42 42 onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y);
43 43 onPointReplaced: console.log("splineSeries.onPointReplaced: " + index);
44 44 onPointRemoved: console.log("splineSeries.onPointRemoved: " + index);
45 45 onPointAdded: console.log("splineSeries.onPointAdded: " + series.at(index).x + ", " + series.at(index).y);
46 46 onColorChanged: console.log("splineSeries.onColorChanged: " + color);
47 47 onCountChanged: console.log("splineSeries.onCountChanged: " + count);
48 48 }
49 49
50 50 SplineSeries {
51 51 name: "spline 2"
52 52 XYPoint { x: 1.1; y: 1.1 }
53 53 XYPoint { x: 1.9; y: 2.3 }
54 54 XYPoint { x: 2.1; y: 1.1 }
55 55 XYPoint { x: 2.9; y: 3.9 }
56 56 XYPoint { x: 3.4; y: 2.0 }
57 57 XYPoint { x: 4.1; y: 2.3 }
58 58 onClicked: console.log(name + ".onClicked: " + point.x + ", " + point.y);
59 59 }
60
61 Component.onCompleted: {
62 createDefaultAxes();
63 }
60 64 }
@@ -1,62 +1,71
1 1 /****************************************************************************
2 2 **
3 3 ** Copyright (C) 2012 Digia Plc
4 4 ** All rights reserved.
5 5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 6 **
7 7 ** This file is part of the Qt Commercial Charts Add-on.
8 8 **
9 9 ** $QT_BEGIN_LICENSE$
10 10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 11 ** accordance with the Qt Commercial License Agreement provided with the
12 12 ** Software or, alternatively, in accordance with the terms contained in
13 13 ** a written agreement between you and Digia.
14 14 **
15 15 ** If you have questions regarding the use of this file, please use
16 16 ** contact form at http://qt.digia.com
17 17 ** $QT_END_LICENSE$
18 18 **
19 19 ****************************************************************************/
20 20
21 21 import QtQuick 1.0
22 22 import QtCommercial.Chart 1.0
23 23
24 24 ChartView {
25 25 title: "Stacked bar series"
26 26 anchors.fill: parent
27 27 theme: ChartView.ChartThemeLight
28 28 legend.alignment: Qt.AlignBottom
29 29
30 property variant series: barSeries
30 property variant series: mySeries
31 31
32 CategoriesAxis {
33 id: myAxis
34 categories: ["2007", "2008", "2009", "2010", "2011", "2012" ]
35 }
36
32 37 StackedBarSeries {
33 id: barSeries
38 id: mySeries
34 39 name: "bar"
35 axisX: CategoriesAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] }
36 40 BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6]
37 41 onClicked: console.log("barset.onClicked: " + index);
38 42 onHovered: console.log("barset.onHovered: " + status);
39 43 onPenChanged: console.log("barset.onPenChanged: " + pen);
40 44 onBrushChanged: console.log("barset.onBrushChanged: " + brush);
41 45 onLabelChanged: console.log("barset.onLabelChanged: " + label);
42 46 onLabelBrushChanged: console.log("barset.onLabelBrushChanged: " + labelBrush);
43 47 onLabelFontChanged: console.log("barset.onLabelFontChanged: " + labelFont);
44 48 onColorChanged: console.log("barset.onColorChanged: " + color);
45 49 onBorderColorChanged: console.log("barset.onBorderColorChanged: " + color);
46 50 onLabelColorChanged: console.log("barset.onLabelColorChanged: " + color);
47 51 onCountChanged: console.log("barset.onCountChanged: " + count);
48 52 onValuesAdded: console.log("barset.onValuesAdded: " + index + ", " + count);
49 53 onValuesRemoved: console.log("barset.onValuesRemoved: " + index + ", " + count);
50 54 onValueChanged: console.log("barset.onValuesChanged: " + index);
51 55 }
52 56 BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] }
53 57 BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] }
54 58
55 59 onNameChanged: console.log("stackedBarSeries.onNameChanged: " + series.name);
56 60 onVisibleChanged: console.log("stackedBarSeries.onVisibleChanged: " + series.visible);
57 61 onClicked: console.log("stackedBarSeries.onClicked: " + barset + " " + index);
58 62 onHovered: console.log("stackedBarSeries.onHovered: " + barset + " " + status);
59 63 onLabelsVisibleChanged: console.log("stackedBarSeries.onLabelsVisibleChanged: " + series.labelsVisible);
60 64 onCountChanged: console.log("stackedBarSeries.onCountChanged: " + count);
61 65 }
66
67 Component.onCompleted: {
68 createDefaultAxes();
69 setAxisX(myAxis,mySeries);
70 }
62 71 }
@@ -1,125 +1,122
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 22 import QtCommercial.Chart 1.0
23 23
24 24 Rectangle {
25 25 id: main
26 26 width: parent.width
27 27 height: parent.height
28 28 property int viewNumber: 0
29 property int viewCount: 10
29 property int viewCount: 9
30 30 property variant colors: ["#637D74", "#403D3A", "#8C3B3B", "#AB6937", "#D4A960"]
31 31 property int colorIndex: 0
32 32
33 33 function nextColor() {
34 34 colorIndex++;
35 35 return colors[colorIndex % colors.length];
36 36 }
37 37
38 38 onViewNumberChanged: {
39 39 if (viewNumber == 0) {
40 40 chartLoader.source = "Chart.qml";
41 41 editorLoader.source = "ChartEditor.qml";
42 42 } else if (viewNumber == 1) {
43 43 chartLoader.source = "PieChart.qml";
44 44 editorLoader.source = "PieEditor.qml";
45 45 } else if (viewNumber == 2) {
46 46 chartLoader.source = "LineChart.qml";
47 47 editorLoader.source = "LineEditor.qml";
48 48 } else if (viewNumber == 3) {
49 49 chartLoader.source = "SplineChart.qml";
50 50 editorLoader.source = "LineEditor.qml";
51 51 } else if (viewNumber == 4) {
52 52 chartLoader.source = "ScatterChart.qml";
53 53 editorLoader.source = "ScatterEditor.qml";
54 54 } else if (viewNumber == 5) {
55 55 chartLoader.source = "AreaChart.qml";
56 56 editorLoader.source = "AreaEditor.qml";
57 57 } else if (viewNumber == 6) {
58 58 chartLoader.source = "BarChart.qml";
59 59 editorLoader.source = "BarEditor.qml";
60 } else if (viewNumber == 7) {
61 chartLoader.source = "GroupedBarChart.qml";
62 editorLoader.source = "BarEditor.qml";
63 } else if (viewNumber == 8) {
60 } else if (viewNumber == 7) {
64 61 chartLoader.source = "StackedBarChart.qml";
65 62 editorLoader.source = "BarEditor.qml";
66 } else if (viewNumber == 9) {
63 } else if (viewNumber == 8) {
67 64 chartLoader.source = "PercentBarChart.qml";
68 65 editorLoader.source = "BarEditor.qml";
69 66 } else {
70 67 console.log("Illegal view number");
71 68 }
72 69 }
73 70
74 71 Row {
75 72 anchors.top: parent.top
76 73 anchors.bottom: buttonRow.top
77 74 anchors.bottomMargin: 10
78 75 anchors.left: parent.left
79 76 anchors.right: parent.right
80 77
81 78 Loader {
82 79 id: chartLoader
83 80 width: main.width - editorLoader.width
84 81 height: parent.height
85 82 source: "Chart.qml"
86 83 onStatusChanged: {
87 84 if (status == Loader.Ready && editorLoader.status == Loader.Ready && chartLoader.item)
88 85 editorLoader.item.series = chartLoader.item.series;
89 86 }
90 87 }
91 88
92 89 Loader {
93 90 id: editorLoader
94 91 width: 280
95 92 height: parent.height
96 93 source: "ChartEditor.qml"
97 94 onStatusChanged: {
98 95 if (status == Loader.Ready && chartLoader.status == Loader.Ready && chartLoader.item)
99 96 editorLoader.item.series = chartLoader.item.series;
100 97 }
101 98 }
102 99 }
103 100
104 101 Row {
105 102 id: buttonRow
106 103 height: 40
107 104 anchors.bottom: parent.bottom
108 105 anchors.horizontalCenter: parent.horizontalCenter
109 106 spacing: 10
110 107
111 108 Button {
112 109 text: "previous"
113 110 onClicked: {
114 111 viewNumber = (viewNumber + viewCount - 1) % viewCount;
115 112 }
116 113 }
117 114
118 115 Button {
119 116 text: "next"
120 117 onClicked: {
121 118 viewNumber = (viewNumber + 1) % viewCount;
122 119 }
123 120 }
124 121 }
125 122 }
@@ -1,27 +1,26
1 1 <RCC>
2 2 <qresource prefix="/">
3 3 <file>qml/qmlchartproperties/loader.qml</file>
4 4 <file>qml/qmlchartproperties/main.qml</file>
5 5 <file>qml/qmlchartproperties/Button.qml</file>
6 6 <file>qml/qmlchartproperties/PieChart.qml</file>
7 7 <file>qml/qmlchartproperties/PieEditor.qml</file>
8 8 <file>qml/qmlchartproperties/LineChart.qml</file>
9 9 <file>qml/qmlchartproperties/LineEditor.qml</file>
10 10 <file>qml/qmlchartproperties/SplineChart.qml</file>
11 11 <file>qml/qmlchartproperties/ScatterChart.qml</file>
12 12 <file>qml/qmlchartproperties/AreaChart.qml</file>
13 13 <file>qml/qmlchartproperties/BarChart.qml</file>
14 14 <file>qml/qmlchartproperties/BarEditor.qml</file>
15 15 <file>qml/qmlchartproperties/ScatterEditor.qml</file>
16 16 <file>qml/qmlchartproperties/AreaEditor.qml</file>
17 <file>qml/qmlchartproperties/GroupedBarChart.qml</file>
18 17 <file>qml/qmlchartproperties/StackedBarChart.qml</file>
19 18 <file>qml/qmlchartproperties/PercentBarChart.qml</file>
20 19 <file>qml/qmlchartproperties/Chart.qml</file>
21 20 <file>qml/qmlchartproperties/ChartEditor.qml</file>
22 21 <file>qml/qmlchartproperties/ChartEditor1.qml</file>
23 22 <file>qml/qmlchartproperties/ChartEditor2.qml</file>
24 23 <file>qml/qmlchartproperties/ChartEditor3.qml</file>
25 24 <file>qml/qmlchartproperties/FontEditor.qml</file>
26 25 </qresource>
27 26 </RCC>
General Comments 0
You need to be logged in to leave comments. Login now