##// END OF EJS Templates
Added missing qml files
Tero Ahola -
r923:aa3acf86d1e9
parent child
Show More
@@ -0,0 +1,74
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Digia Plc
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
7 ** This file is part of the Qt Commercial Charts Add-on.
8 **
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 ** accordance with the Qt Commercial License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
14 **
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
18 **
19 ****************************************************************************/
20
21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
23
24 Rectangle {
25 width: parent.width
26 height: parent.height
27
28 // Another option for QML data api:
29 // ListModel {
30 // id: listModelForPie
31 // // PieDataElement
32 // ListElement {
33 // label: "Apple"
34 // value: 4.3
35 // }
36 // ListElement {
37 // label: "Blackberry"
38 // value: 15.1
39 // }
40 // }
41
42 Component.onCompleted: {
43 // console.log("model:" + myModel.item(0));
44 // myModel.insert(1, {"time":1.4; "speed":41.1 });
45 // scatter.appendData();
46 // chart1.theme = Chart.ThemeHighContrast;
47 // chart2.theme = Chart.ThemeHighContrast;
48 }
49
50 Chart {
51 id: chart1
52 anchors.fill: parent
53 theme: Chart.ChartThemeDark
54
55 BarSeries {
56 barCategories: [ "2008", "2009", "2010", "2011", "2012" ]
57 // TBD: data
58 }
59
60 PieSeries {
61 horizontalPosition: 0.2
62 verticalPosition: 0.3
63 size: 0.4
64 endAngle: 0.52 * 360 // The share of "others" is 52%
65 slices: [
66 PieSlice { label: "Volkswagen"; value: 13.5 },
67 PieSlice { label: "Toyota"; value: 10.9 },
68 PieSlice { label: "Ford"; value: 8.6 },
69 PieSlice { label: "Skoda"; value: 8.2 },
70 PieSlice { label: "Volvo"; value: 6.8 }
71 ]
72 }
73 }
74 }
@@ -0,0 +1,51
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Digia Plc
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
7 ** This file is part of the Qt Commercial Charts Add-on.
8 **
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 ** accordance with the Qt Commercial License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
14 **
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
18 **
19 ****************************************************************************/
20
21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
23
24 Rectangle {
25 anchors.fill: parent
26
27 Chart {
28 anchors.fill: parent
29 theme: Chart.ChartThemeBrownSand
30
31 LineSeries {
32 name: "Line"
33 points: [
34 XyPoint { x: 0.0; y: 0.0 },
35 XyPoint { x: 1.1; y: 2.1 },
36 XyPoint { x: 2.9; y: 4.9 },
37 XyPoint { x: 3.2; y: 3.0 }
38 ]
39 }
40
41 SplineSeries {
42 name: "Spline"
43 points: [
44 XyPoint { x: 0.0; y: 0.3 },
45 XyPoint { x: 1.1; y: 3.2 },
46 XyPoint { x: 2.17; y: 2.15 },
47 XyPoint { x: 4.17; y: 3.15 }
48 ]
49 }
50 }
51 }
@@ -0,0 +1,70
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Digia Plc
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
7 ** This file is part of the Qt Commercial Charts Add-on.
8 **
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 ** accordance with the Qt Commercial License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
14 **
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
18 **
19 ****************************************************************************/
20
21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
23
24 Rectangle {
25 anchors.fill: parent
26
27 Chart {
28 anchors.fill: parent
29 theme: Chart.ChartThemeHighContrast
30
31 AreaSeries {
32 name: "Area"
33 points: [
34 XyPoint { x: 0.0; y: 1.1 },
35 XyPoint { x: 2.5; y: 3.6 },
36 XyPoint { x: 3.57; y: 2.55 }
37 ]
38 lowerPoints: [
39 XyPoint { x: 0.0; y: 0.0 },
40 XyPoint { x: 2.5; y: 0.0 },
41 XyPoint { x: 3.57; y: 0.0 }
42 ]
43 }
44
45 ScatterSeries {
46 name: "Scatter1"
47 points: [
48 XyPoint { x: 1.5; y: 1.5 },
49 XyPoint { x: 1.5; y: 1.6 },
50 XyPoint { x: 1.57; y: 1.55 }
51 ]
52 }
53 ScatterSeries {
54 name: "Scatter2"
55 points: [
56 XyPoint { x: 2.0; y: 2.0 },
57 XyPoint { x: 2.0; y: 2.1 },
58 XyPoint { x: 2.07; y: 2.05 }
59 ]
60 }
61 ScatterSeries {
62 name: "Scatter3"
63 points: [
64 XyPoint { x: 2.6; y: 2.6 },
65 XyPoint { x: 2.6; y: 2.7 },
66 XyPoint { x: 2.67; y: 2.65 }
67 ]
68 }
69 }
70 }
@@ -0,0 +1,37
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Digia Plc
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
7 ** This file is part of the Qt Commercial Charts Add-on.
8 **
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 ** accordance with the Qt Commercial License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
14 **
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
18 **
19 ****************************************************************************/
20
21 import QtQuick 1.0
22
23 Item {
24 id: container
25 width: 400
26 height: 300
27 Component.onCompleted: {
28 var co = Qt.createComponent("main.qml")
29 if (co.status == Component.Ready) {
30 var o = co.createObject(container)
31 } else {
32 console.log(co.errorString())
33 console.log("QtCommercial.Chart 1.1 not available")
34 console.log("Please use correct QML_IMPORT_PATH export")
35 }
36 }
37 }
@@ -0,0 +1,54
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Digia Plc
4 ** All rights reserved.
5 ** For any questions to Digia, please use contact form at http://qt.digia.com
6 **
7 ** This file is part of the Qt Commercial Charts Add-on.
8 **
9 ** $QT_BEGIN_LICENSE$
10 ** Licensees holding valid Qt Commercial licenses may use this file in
11 ** accordance with the Qt Commercial License Agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia.
14 **
15 ** If you have questions regarding the use of this file, please use
16 ** contact form at http://qt.digia.com
17 ** $QT_END_LICENSE$
18 **
19 ****************************************************************************/
20
21 import QtQuick 1.0
22 import QtCommercial.Chart 1.0
23
24 Rectangle {
25 width: parent.width
26 height: parent.height
27 property int __viewNumber: 0
28
29 Timer {
30 id: timer
31 running: true
32 repeat: true
33 interval: 5000
34 triggeredOnStart: true
35 onTriggered: {
36 loader.source = "View" + (__viewNumber % 3 + 1) + ".qml";
37 __viewNumber++;
38 }
39 }
40
41 Loader {
42 id: loader
43 anchors.fill: parent
44 }
45
46 MouseArea {
47 anchors.fill: parent
48 onClicked: {
49 timer.restart();
50 loader.source = "View" + (__viewNumber % 3 + 1) + ".qml";
51 __viewNumber++;
52 }
53 }
54 }
General Comments 0
You need to be logged in to leave comments. Login now