##// END OF EJS Templates
Fixed a bug in horizontal bar qml testers
Tero Ahola -
r1915:f0273809c626
parent child
Show More
@@ -1,64 +1,63
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.1
22 import QtCommercial.Chart 1.1
23
23
24 ChartView {
24 ChartView {
25 title: "Bar series"
25 title: "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 animationOptions: ChartView.SeriesAnimations
29 animationOptions: ChartView.SeriesAnimations
30
30
31 property variant series: mySeries
31 property variant series: mySeries
32
32
33
34 HorizontalBarSeries {
33 HorizontalBarSeries {
35 id: mySeries
34 id: mySeries
36 name: "bar"
35 name: "bar"
37 axisX: BarCategoryAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] }
36 axisY: BarCategoryAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] }
38 BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6]
37 BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6]
39 onClicked: console.log("barset.onClicked: " + index);
38 onClicked: console.log("barset.onClicked: " + index);
40 onHovered: console.log("barset.onHovered: " + status);
39 onHovered: console.log("barset.onHovered: " + status);
41 onPenChanged: console.log("barset.onPenChanged: " + pen);
40 onPenChanged: console.log("barset.onPenChanged: " + pen);
42 onBrushChanged: console.log("barset.onBrushChanged: " + brush);
41 onBrushChanged: console.log("barset.onBrushChanged: " + brush);
43 onLabelChanged: console.log("barset.onLabelChanged: " + label);
42 onLabelChanged: console.log("barset.onLabelChanged: " + label);
44 onLabelBrushChanged: console.log("barset.onLabelBrushChanged: " + labelBrush);
43 onLabelBrushChanged: console.log("barset.onLabelBrushChanged: " + labelBrush);
45 onLabelFontChanged: console.log("barset.onLabelFontChanged: " + labelFont);
44 onLabelFontChanged: console.log("barset.onLabelFontChanged: " + labelFont);
46 onColorChanged: console.log("barset.onColorChanged: " + color);
45 onColorChanged: console.log("barset.onColorChanged: " + color);
47 onBorderColorChanged: console.log("barset.onBorderColorChanged: " + color);
46 onBorderColorChanged: console.log("barset.onBorderColorChanged: " + color);
48 onLabelColorChanged: console.log("barset.onLabelColorChanged: " + color);
47 onLabelColorChanged: console.log("barset.onLabelColorChanged: " + color);
49 onCountChanged: console.log("barset.onCountChanged: " + count);
48 onCountChanged: console.log("barset.onCountChanged: " + count);
50 onValuesAdded: console.log("barset.onValuesAdded: " + index + ", " + count);
49 onValuesAdded: console.log("barset.onValuesAdded: " + index + ", " + count);
51 onValuesRemoved: console.log("barset.onValuesRemoved: " + index + ", " + count);
50 onValuesRemoved: console.log("barset.onValuesRemoved: " + index + ", " + count);
52 onValueChanged: console.log("barset.onValuesChanged: " + index);
51 onValueChanged: console.log("barset.onValuesChanged: " + index);
53 }
52 }
54 BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] }
53 BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] }
55 BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] }
54 BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] }
56
55
57 onNameChanged: console.log("groupedBarSeries.onNameChanged: " + series.name);
56 onNameChanged: console.log("groupedBarSeries.onNameChanged: " + series.name);
58 onVisibleChanged: console.log("groupedBarSeries.onVisibleChanged: " + series.visible);
57 onVisibleChanged: console.log("groupedBarSeries.onVisibleChanged: " + series.visible);
59 onClicked: console.log("groupedBarSeries.onClicked: " + barset + " " + index);
58 onClicked: console.log("groupedBarSeries.onClicked: " + barset + " " + index);
60 onHovered: console.log("groupedBarSeries.onHovered: " + barset + " " + status);
59 onHovered: console.log("groupedBarSeries.onHovered: " + barset + " " + status);
61 onLabelsVisibleChanged: console.log("groupedBarSeries.onLabelsVisibleChanged: " + series.labelsVisible);
60 onLabelsVisibleChanged: console.log("groupedBarSeries.onLabelsVisibleChanged: " + series.labelsVisible);
62 onCountChanged: console.log("groupedBarSeries.onCountChanged: " + count);
61 onCountChanged: console.log("groupedBarSeries.onCountChanged: " + count);
63 }
62 }
64 }
63 }
@@ -1,64 +1,63
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.1
22 import QtCommercial.Chart 1.1
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 animationOptions: ChartView.SeriesAnimations
29 animationOptions: ChartView.SeriesAnimations
30
30
31 property variant series: mySeries
31 property variant series: mySeries
32
32
33 HorizontalPercentBarSeries {
33 HorizontalPercentBarSeries {
34 id: mySeries
34 id: mySeries
35 name: "bar"
35 name: "bar"
36 axisX: BarCategoryAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] }
36 axisY: BarCategoryAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] }
37
38 BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6]
37 BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6]
39 onClicked: console.log("barset.onClicked: " + index);
38 onClicked: console.log("barset.onClicked: " + index);
40 onHovered: console.log("barset.onHovered: " + status);
39 onHovered: console.log("barset.onHovered: " + status);
41 onPenChanged: console.log("barset.onPenChanged: " + pen);
40 onPenChanged: console.log("barset.onPenChanged: " + pen);
42 onBrushChanged: console.log("barset.onBrushChanged: " + brush);
41 onBrushChanged: console.log("barset.onBrushChanged: " + brush);
43 onLabelChanged: console.log("barset.onLabelChanged: " + label);
42 onLabelChanged: console.log("barset.onLabelChanged: " + label);
44 onLabelBrushChanged: console.log("barset.onLabelBrushChanged: " + labelBrush);
43 onLabelBrushChanged: console.log("barset.onLabelBrushChanged: " + labelBrush);
45 onLabelFontChanged: console.log("barset.onLabelFontChanged: " + labelFont);
44 onLabelFontChanged: console.log("barset.onLabelFontChanged: " + labelFont);
46 onColorChanged: console.log("barset.onColorChanged: " + color);
45 onColorChanged: console.log("barset.onColorChanged: " + color);
47 onBorderColorChanged: console.log("barset.onBorderColorChanged: " + color);
46 onBorderColorChanged: console.log("barset.onBorderColorChanged: " + color);
48 onLabelColorChanged: console.log("barset.onLabelColorChanged: " + color);
47 onLabelColorChanged: console.log("barset.onLabelColorChanged: " + color);
49 onCountChanged: console.log("barset.onCountChanged: " + count);
48 onCountChanged: console.log("barset.onCountChanged: " + count);
50 onValuesAdded: console.log("barset.onValuesAdded: " + index + ", " + count);
49 onValuesAdded: console.log("barset.onValuesAdded: " + index + ", " + count);
51 onValuesRemoved: console.log("barset.onValuesRemoved: " + index + ", " + count);
50 onValuesRemoved: console.log("barset.onValuesRemoved: " + index + ", " + count);
52 onValueChanged: console.log("barset.onValuesChanged: " + index);
51 onValueChanged: console.log("barset.onValuesChanged: " + index);
53 }
52 }
54 BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] }
53 BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] }
55 BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] }
54 BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] }
56
55
57 onNameChanged: console.log("percentBarSeries.onNameChanged: " + series.name);
56 onNameChanged: console.log("percentBarSeries.onNameChanged: " + series.name);
58 onVisibleChanged: console.log("percentBarSeries.onVisibleChanged: " + series.visible);
57 onVisibleChanged: console.log("percentBarSeries.onVisibleChanged: " + series.visible);
59 onClicked: console.log("percentBarSeries.onClicked: " + barset + " " + index);
58 onClicked: console.log("percentBarSeries.onClicked: " + barset + " " + index);
60 onHovered: console.log("percentBarSeries.onHovered: " + barset + " " + status);
59 onHovered: console.log("percentBarSeries.onHovered: " + barset + " " + status);
61 onLabelsVisibleChanged: console.log("percentBarSeries.onLabelsVisibleChanged: " + series.labelsVisible);
60 onLabelsVisibleChanged: console.log("percentBarSeries.onLabelsVisibleChanged: " + series.labelsVisible);
62 onCountChanged: console.log("percentBarSeries.onCountChanged: " + count);
61 onCountChanged: console.log("percentBarSeries.onCountChanged: " + count);
63 }
62 }
64 }
63 }
@@ -1,63 +1,63
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.1
22 import QtCommercial.Chart 1.1
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 animationOptions: ChartView.SeriesAnimations
29 animationOptions: ChartView.SeriesAnimations
30
30
31 property variant series: mySeries
31 property variant series: mySeries
32
32
33 HorizontalStackedBarSeries {
33 HorizontalStackedBarSeries {
34 id: mySeries
34 id: mySeries
35 name: "bar"
35 name: "bar"
36 axisX: BarCategoryAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] }
36 axisY: BarCategoryAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] }
37 BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6]
37 BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6]
38 onClicked: console.log("barset.onClicked: " + index);
38 onClicked: console.log("barset.onClicked: " + index);
39 onHovered: console.log("barset.onHovered: " + status);
39 onHovered: console.log("barset.onHovered: " + status);
40 onPenChanged: console.log("barset.onPenChanged: " + pen);
40 onPenChanged: console.log("barset.onPenChanged: " + pen);
41 onBrushChanged: console.log("barset.onBrushChanged: " + brush);
41 onBrushChanged: console.log("barset.onBrushChanged: " + brush);
42 onLabelChanged: console.log("barset.onLabelChanged: " + label);
42 onLabelChanged: console.log("barset.onLabelChanged: " + label);
43 onLabelBrushChanged: console.log("barset.onLabelBrushChanged: " + labelBrush);
43 onLabelBrushChanged: console.log("barset.onLabelBrushChanged: " + labelBrush);
44 onLabelFontChanged: console.log("barset.onLabelFontChanged: " + labelFont);
44 onLabelFontChanged: console.log("barset.onLabelFontChanged: " + labelFont);
45 onColorChanged: console.log("barset.onColorChanged: " + color);
45 onColorChanged: console.log("barset.onColorChanged: " + color);
46 onBorderColorChanged: console.log("barset.onBorderColorChanged: " + color);
46 onBorderColorChanged: console.log("barset.onBorderColorChanged: " + color);
47 onLabelColorChanged: console.log("barset.onLabelColorChanged: " + color);
47 onLabelColorChanged: console.log("barset.onLabelColorChanged: " + color);
48 onCountChanged: console.log("barset.onCountChanged: " + count);
48 onCountChanged: console.log("barset.onCountChanged: " + count);
49 onValuesAdded: console.log("barset.onValuesAdded: " + index + ", " + count);
49 onValuesAdded: console.log("barset.onValuesAdded: " + index + ", " + count);
50 onValuesRemoved: console.log("barset.onValuesRemoved: " + index + ", " + count);
50 onValuesRemoved: console.log("barset.onValuesRemoved: " + index + ", " + count);
51 onValueChanged: console.log("barset.onValuesChanged: " + index);
51 onValueChanged: console.log("barset.onValuesChanged: " + index);
52 }
52 }
53 BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] }
53 BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] }
54 BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] }
54 BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] }
55
55
56 onNameChanged: console.log("stackedBarSeries.onNameChanged: " + series.name);
56 onNameChanged: console.log("stackedBarSeries.onNameChanged: " + series.name);
57 onVisibleChanged: console.log("stackedBarSeries.onVisibleChanged: " + series.visible);
57 onVisibleChanged: console.log("stackedBarSeries.onVisibleChanged: " + series.visible);
58 onClicked: console.log("stackedBarSeries.onClicked: " + barset + " " + index);
58 onClicked: console.log("stackedBarSeries.onClicked: " + barset + " " + index);
59 onHovered: console.log("stackedBarSeries.onHovered: " + barset + " " + status);
59 onHovered: console.log("stackedBarSeries.onHovered: " + barset + " " + status);
60 onLabelsVisibleChanged: console.log("stackedBarSeries.onLabelsVisibleChanged: " + series.labelsVisible);
60 onLabelsVisibleChanged: console.log("stackedBarSeries.onLabelsVisibleChanged: " + series.labelsVisible);
61 onCountChanged: console.log("stackedBarSeries.onCountChanged: " + count);
61 onCountChanged: console.log("stackedBarSeries.onCountChanged: " + count);
62 }
62 }
63 }
63 }
General Comments 0
You need to be logged in to leave comments. Login now