##// END OF EJS Templates
Work-around for QML drawing issue
Tero Ahola -
r199:12a66e29cabc
parent child
Show More
@@ -4,10 +4,6 import QtCommercial.Chart 1.0
4 4 Rectangle {
5 5 width: 360
6 6 height: 360
7 Text {
8 text: qsTr("Hello World")
9 anchors.centerIn: parent
10 }
11 7
12 8 // Another option for QML data api:
13 9 // ListModel {
@@ -34,9 +30,15 Rectangle {
34 30 // console.log("Component.onCompleted: " + chartModel.get(0).dataX);
35 31 }
36 32
33 // TODO: a bug: drawing order affects the drawing; if you draw chart1 first (by changing the
34 // z-order), then chart2 is not shown at all. By drawing chart2 first, both are visible.
37 35 Chart {
38 anchors.fill: parent
39 theme: Chart.ThemeIcy
36 id: chart2
37 anchors.top: chart1.bottom
38 anchors.bottom: parent.bottom
39 anchors.left: parent.left
40 anchors.right: parent.right
41 theme: Chart.ThemeScientific
40 42
41 43 ScatterSeries {
42 44 id: scatterSeries
@@ -44,32 +46,32 Rectangle {
44 46 ScatterElement { x: 1.1; y: 2.1 },
45 47 ScatterElement { x: 1.2; y: 2.0 },
46 48 ScatterElement { x: 1.4; y: 2.3 },
47 ScatterElement { x: 1.9; y: 2.5 },
48 ScatterElement { x: 1.9; y: 3.4 },
49 ScatterElement { x: 2.9; y: 1.4 },
50 ScatterElement { x: 2.9; y: 2.4 },
51 49 ScatterElement { x: 3.1; y: 5.3 },
52 50 ScatterElement { x: 4.1; y: 3.7 }
53 51 ]
54 Component.onCompleted: {
55 console.log("onCompleted " + data);
56 // console.log("onCompleted " + data.get(0));
57 // console.log("onCompleted " + data.get(0).x);
58 // var element = {"x": 9.9, "y": 8.5};
59 // data.append(element);
60 }
61 52 }
53 }
62 54
63 // Series {
64 // seriesType: Series.SeriesTypePie
65 // }
55 Chart {
56 id: chart1
57 anchors.top: parent.top
58 anchors.left: parent.left
59 anchors.right: parent.right
60 height: parent.height / 2
61 theme: Chart.ThemeIcy
62 opacity: 0.3
66 63
67 // Series {
68 // seriesType: Series.SeriesTypeLine
69 // }
64 Series {
65 seriesType: Series.SeriesTypePie
66 }
67
68 Series {
69 seriesType: Series.SeriesTypeLine
70 }
70 71 // TODO:
71 72 // Series {
72 73 // seriesType: Series.SeriesTypeBar
73 74 // }
74 75 }
76
75 77 }
General Comments 0
You need to be logged in to leave comments. Login now