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