summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--demos/qmlchart/qml/qmlchart/View10.qml48
-rw-r--r--demos/qmlchart/qml/qmlchart/View11.qml49
-rw-r--r--demos/qmlchart/qml/qmlchart/View9.qml49
-rw-r--r--demos/qmlchart/qml/qmlchart/main.qml4
-rw-r--r--demos/qmlchart/resources.qrc3
-rw-r--r--plugins/declarative/declarativechart.cpp9
-rw-r--r--plugins/declarative/declarativechart.h5
-rw-r--r--plugins/declarative/plugin.cpp3
8 files changed, 167 insertions, 3 deletions
diff --git a/demos/qmlchart/qml/qmlchart/View10.qml b/demos/qmlchart/qml/qmlchart/View10.qml
new file mode 100644
index 00000000..4e231069
--- /dev/null
+++ b/demos/qmlchart/qml/qmlchart/View10.qml
@@ -0,0 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc
+** All rights reserved.
+** For any questions to Digia, please use contact form at http://qt.digia.com
+**
+** This file is part of the Qt Commercial Charts Add-on.
+**
+** $QT_BEGIN_LICENSE$
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.
+**
+** If you have questions regarding the use of this file, please use
+** contact form at http://qt.digia.com
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtCommercial.Chart 1.0
+
+Rectangle {
+ anchors.fill: parent
+
+ //![1]
+ ChartView {
+ title: "Horizontal Stacked Bar series"
+ anchors.fill: parent
+ legend.alignment: Qt.AlignBottom
+ BarCategoriesAxis {
+ id: myAxis;
+ categories: ["2007", "2008", "2009", "2010", "2011", "2012" ]
+ }
+ HorizontalStackedBarSeries {
+ id: mySeries;
+ BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6] }
+ BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] }
+ BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] }
+ }
+ Component.onCompleted: {
+ createDefaultAxes();
+ setAxisY(myAxis,mySeries);
+ }
+ }
+ //![1]
+}
diff --git a/demos/qmlchart/qml/qmlchart/View11.qml b/demos/qmlchart/qml/qmlchart/View11.qml
new file mode 100644
index 00000000..63d1e415
--- /dev/null
+++ b/demos/qmlchart/qml/qmlchart/View11.qml
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc
+** All rights reserved.
+** For any questions to Digia, please use contact form at http://qt.digia.com
+**
+** This file is part of the Qt Commercial Charts Add-on.
+**
+** $QT_BEGIN_LICENSE$
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.
+**
+** If you have questions regarding the use of this file, please use
+** contact form at http://qt.digia.com
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtCommercial.Chart 1.0
+
+Rectangle {
+ anchors.fill: parent
+
+ //![1]
+ ChartView {
+ title: "Horizontal Percent Bar series"
+ anchors.fill: parent
+ legend.alignment: Qt.AlignBottom
+ BarCategoriesAxis {
+ id: myAxis
+ categories: ["2007", "2008", "2009", "2010", "2011", "2012" ]
+ }
+ HorizontalPercentBarSeries {
+ id: mySeries
+ BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6] }
+ BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] }
+ BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] }
+ }
+ Component.onCompleted: {
+ createDefaultAxes();
+ setAxisY(myAxis,mySeries);
+ }
+ }
+ //![1]
+}
+
diff --git a/demos/qmlchart/qml/qmlchart/View9.qml b/demos/qmlchart/qml/qmlchart/View9.qml
new file mode 100644
index 00000000..2c350b8e
--- /dev/null
+++ b/demos/qmlchart/qml/qmlchart/View9.qml
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc
+** All rights reserved.
+** For any questions to Digia, please use contact form at http://qt.digia.com
+**
+** This file is part of the Qt Commercial Charts Add-on.
+**
+** $QT_BEGIN_LICENSE$
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.
+**
+** If you have questions regarding the use of this file, please use
+** contact form at http://qt.digia.com
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import QtCommercial.Chart 1.0
+
+Rectangle {
+ anchors.fill: parent
+
+ //![1]
+ ChartView {
+ title: "Horizontal Bar series"
+ anchors.fill: parent
+ legend.alignment: Qt.AlignBottom
+ BarCategoriesAxis {
+ id: myAxis
+ categories: ["2007", "2008", "2009", "2010", "2011", "2012" ]
+ }
+ HorizontalBarSeries {
+ id: mySeries
+ BarSet { label: "Bob"; values: [2, 2, 3, 4, 5, 6] }
+ BarSet { label: "Susan"; values: [5, 1, 2, 4, 1, 7] }
+ BarSet { label: "James"; values: [3, 5, 8, 13, 5, 8] }
+ }
+ Component.onCompleted: {
+ createDefaultAxes();
+ setAxisY(myAxis,mySeries);
+ }
+ }
+ //![1]
+}
+
diff --git a/demos/qmlchart/qml/qmlchart/main.qml b/demos/qmlchart/qml/qmlchart/main.qml
index 4017db22..26b16875 100644
--- a/demos/qmlchart/qml/qmlchart/main.qml
+++ b/demos/qmlchart/qml/qmlchart/main.qml
@@ -74,7 +74,7 @@ Rectangle {
function nextView() {
var i = viewNumber + 1;
- if (i > 8)
+ if (i > 11)
viewNumber = 1;
else
viewNumber = i;
@@ -83,7 +83,7 @@ Rectangle {
function previousView() {
var i = viewNumber - 1;
if (i <= 0)
- viewNumber = 8;
+ viewNumber = 11;
else
viewNumber = i;
}
diff --git a/demos/qmlchart/resources.qrc b/demos/qmlchart/resources.qrc
index bf03f1bd..d7176883 100644
--- a/demos/qmlchart/resources.qrc
+++ b/demos/qmlchart/resources.qrc
@@ -10,5 +10,8 @@
<file>qml/qmlchart/View6.qml</file>
<file>qml/qmlchart/View7.qml</file>
<file>qml/qmlchart/View8.qml</file>
+ <file>qml/qmlchart/View9.qml</file>
+ <file>qml/qmlchart/View10.qml</file>
+ <file>qml/qmlchart/View11.qml</file>
</qresource>
</RCC>
diff --git a/plugins/declarative/declarativechart.cpp b/plugins/declarative/declarativechart.cpp
index 4d46e8c3..10787a5f 100644
--- a/plugins/declarative/declarativechart.cpp
+++ b/plugins/declarative/declarativechart.cpp
@@ -478,6 +478,15 @@ QAbstractSeries *DeclarativeChart::createSeries(DeclarativeChart::SeriesType typ
case DeclarativeChart::SeriesTypeBar:
series = new DeclarativeBarSeries();
break;
+ case DeclarativeChart::SeriesTypeHorizontalBar:
+ series = new DeclarativeHorizontalBarSeries();
+ break;
+ case DeclarativeChart::SeriesTypeHorizontalPercentBar:
+ series = new DeclarativeHorizontalPercentBarSeries();
+ break;
+ case DeclarativeChart::SeriesTypeHorizontalStackedBar:
+ series = new DeclarativeHorizontalStackedBarSeries();
+ break;
case DeclarativeChart::SeriesTypePie:
series = new DeclarativePieSeries();
break;
diff --git a/plugins/declarative/declarativechart.h b/plugins/declarative/declarativechart.h
index c8481b80..4af7a576 100644
--- a/plugins/declarative/declarativechart.h
+++ b/plugins/declarative/declarativechart.h
@@ -77,7 +77,10 @@ public:
SeriesTypePercentBar,
SeriesTypePie,
SeriesTypeScatter,
- SeriesTypeSpline
+ SeriesTypeSpline,
+ SeriesTypeHorizontalBar,
+ SeriesTypeHorizontalStackedBar,
+ SeriesTypeHorizontalPercentBar
};
public:
diff --git a/plugins/declarative/plugin.cpp b/plugins/declarative/plugin.cpp
index 9569e986..dedf835a 100644
--- a/plugins/declarative/plugin.cpp
+++ b/plugins/declarative/plugin.cpp
@@ -59,6 +59,9 @@ public:
qmlRegisterType<DeclarativeBarSeries>(uri, 1, 0, "BarSeries");
qmlRegisterType<DeclarativeStackedBarSeries>(uri, 1, 0, "StackedBarSeries");
qmlRegisterType<DeclarativePercentBarSeries>(uri, 1, 0, "PercentBarSeries");
+ qmlRegisterType<DeclarativeHorizontalBarSeries>(uri, 1, 0, "HorizontalBarSeries");
+ qmlRegisterType<DeclarativeHorizontalStackedBarSeries>(uri, 1, 0, "HorizontalStackedBarSeries");
+ qmlRegisterType<DeclarativeHorizontalPercentBarSeries>(uri, 1, 0, "HorizontalPercentBarSeries");
qmlRegisterType<DeclarativePieSeries>(uri, 1, 0, "PieSeries");
qmlRegisterType<QPieSlice>(uri, 1, 0, "PieSlice");
qmlRegisterType<DeclarativeBarSet>(uri, 1, 0, "BarSet");