##// END OF EJS Templates
Documentation: QML demos, bar screens, legend detach screen
Tero Ahola -
r1380:ae04ff07a29b
parent child
Show More
1 NO CONTENT: new file 100644, binary diff hidden
1 NO CONTENT: new file 100644, binary diff hidden
1 NO CONTENT: new file 100644, binary diff hidden
1 NO CONTENT: new file 100644, binary diff hidden
1 NO CONTENT: new file 100644, binary diff hidden
1 NO CONTENT: new file 100644, binary diff hidden
@@ -26,15 +26,13 Rectangle {
26 26 property int __explodedIndex: -1
27 27 property variant otherSlice: 0
28 28
29 //![1]
29 30 ChartView {
30 31 id: chart
31 32 title: "Top-5 car brand shares in Finland"
32 33 anchors.fill: parent
33 theme: ChartView.ChartThemeLight
34 34 legend.alignment: Qt.AlignBottom
35 animationOptions: ChartView.SeriesAnimations
36 35
37 // If you have static data, you can simply use the PieSlice API
38 36 PieSeries {
39 37 id: pieSeries
40 38 onClicked: {
@@ -47,6 +45,7 Rectangle {
47 45 PieSlice { label: "Volvo"; value: 6.8 }
48 46 }
49 47 }
48 //![1]
50 49
51 50 Component.onCompleted: {
52 51 // You can also add slices dynamically
@@ -24,11 +24,10 import QtCommercial.Chart 1.0
24 24 Rectangle {
25 25 anchors.fill: parent
26 26
27 //![1]
27 28 ChartView {
28 29 title: "Line&Spline"
29 30 anchors.fill: parent
30 theme: ChartView.ChartThemeBrownSand
31 animationOptions: ChartView.NoAnimation
32 31
33 32 LineSeries {
34 33 name: "Line"
@@ -52,4 +51,5 Rectangle {
52 51 XyPoint { x: 4.1; y: 3.1 }
53 52 }
54 53 }
54 //![1]
55 55 }
@@ -24,10 +24,10 import QtCommercial.Chart 1.0
24 24 Rectangle {
25 25 anchors.fill: parent
26 26
27 //![1]
27 28 ChartView {
28 29 title: "NHL All-Star Team Players"
29 30 anchors.fill: parent
30 theme: ChartView.ChartThemeHighContrast
31 31 axisXLabels: ["0", "2000", "1", "2001", "2", "2002", "3", "2003", "4", "2004", "5", "2005",
32 32 "6", "2006", "7", "2007", "8", "2008", "9", "2009", "10", "2010", "11", "2011"]
33 33
@@ -61,11 +61,9 Rectangle {
61 61 XyPoint { x: 10; y: 0 }
62 62 XyPoint { x: 11; y: 0 }
63 63 }
64 onClicked: {
65 color = "red";
66 borderColor = "black";
67 }
68 64 }
65 // ...
66 //![1]
69 67
70 68 AreaSeries {
71 69 id: swedish
@@ -24,12 +24,10 import QtCommercial.Chart 1.0
24 24 Rectangle {
25 25 anchors.fill: parent
26 26
27 //![1]
27 28 ChartView {
28 29 title: "Scatters"
29 30 anchors.fill: parent
30 theme: ChartView.ChartThemeBlueCerulean
31 axisX.max: 4
32 axisY.max: 4
33 31
34 32 ScatterSeries {
35 33 id: scatter1
@@ -45,6 +43,8 Rectangle {
45 43
46 44 ScatterSeries {
47 45 name: "Scatter2"
46 // ...
47 //![1]
48 48 XyPoint { x: 2.0; y: 2.0 }
49 49 XyPoint { x: 2.0; y: 2.1 }
50 50 XyPoint { x: 2.07; y: 2.05 }
@@ -24,10 +24,10 import QtCommercial.Chart 1.0
24 24 Rectangle {
25 25 anchors.fill: parent
26 26
27 //![1]
27 28 ChartView {
28 29 title: "Bar series"
29 30 anchors.fill: parent
30 theme: ChartView.ChartThemeLight
31 31 legend.alignment: Qt.AlignBottom
32 32 axisXLabels: ["0", "2007", "1", "2008", "2", "2009", "3", "2010", "4", "2011", "5", "2012"]
33 33
@@ -37,4 +37,5 Rectangle {
37 37 BarSet { name: "James"; values: [3, 5, 8, 13, 5, 8] }
38 38 }
39 39 }
40 //![1]
40 41 }
@@ -44,12 +44,12 Rectangle {
44 44
45 45 Rectangle {
46 46 height: 35
47 width: 55
48 color: "grey"
47 width: 60
48 color: "#c8955c"
49 49 radius: 5
50 50 Text {
51 51 anchors.centerIn: parent
52 text: "previous"
52 text: "<"
53 53 }
54 54 MouseArea {
55 55 anchors.fill: parent
@@ -64,12 +64,12 Rectangle {
64 64 }
65 65 Rectangle {
66 66 height: 35
67 width: 55
68 color: "grey"
67 width: 60
68 color: "#c8955c"
69 69 radius: 5
70 70 Text {
71 71 anchors.centerIn: parent
72 text: "next"
72 text: ">"
73 73 }
74 74 MouseArea {
75 75 anchors.fill: parent
1 NO CONTENT: modified file, binary diff hidden
1 NO CONTENT: modified file, binary diff hidden
1 NO CONTENT: modified file, binary diff hidden
@@ -3,5 +3,25
3 3 \title Qml charts demo
4 4 \subtitle
5 5
6 This is a basic demonstration how to use the different chart types by using qml.
6 This is a basic demonstration how to use the different chart types by using qml. Creating each chart type begins
7 with creation of a ChartView. For example to create a pie, we use the PieSeries API together with a few PieSlices:
8 \snippet ../demos/qmlchart/qml/qmlchart/View1.qml 1
9 \image demos_qmlchart1.png
10
11 To create a chart with line and spline series:
12 \snippet ../demos/qmlchart/qml/qmlchart/View2.qml 1
13 \image demos_qmlchart2.png
14
15 Then we create a chart that illustrates the success of Russian, Swedish and Finnish ice-hockey players in the
16 NHL All-Star player selections by using three area series:
17 \snippet ../demos/qmlchart/qml/qmlchart/View3.qml 1
18 \image demos_qmlchart3.png
19
20 Then couple of scatter series:
21 \snippet ../demos/qmlchart/qml/qmlchart/View4.qml 1
22 \image demos_qmlchart4.png
23
24 And finally a bar series:
25 \snippet ../demos/qmlchart/qml/qmlchart/View5.qml 1
26 \image demos_qmlchart5.png
7 27 */
@@ -5,7 +5,9
5 5
6 6 This example shows how to detach legend from chart and how to attach it back. By default the chart
7 7 draws the legend inside same view with the chart. In some cases user may want to draw legend to somewhere else. To make this possible the legend can be detached from the chart. Detaching means that chart doesn't draw the legend or try to change it's layout. Detached can then be drawn where user wants, for example in different graphics scene. In this example we do so.
8
8
9 \image examples_legend_detach.png
10
9 11 First we create our chart as usual.
10 12
11 13 \snippet ../examples/legend/mainwidget.cpp 1
General Comments 0
You need to be logged in to leave comments. Login now