summaryrefslogtreecommitdiffstats
path: root/examples/charts/qmlchartsgallery/qml/BarSeriesHorizontal.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/charts/qmlchartsgallery/qml/BarSeriesHorizontal.qml')
-rw-r--r--examples/charts/qmlchartsgallery/qml/BarSeriesHorizontal.qml21
1 files changed, 21 insertions, 0 deletions
diff --git a/examples/charts/qmlchartsgallery/qml/BarSeriesHorizontal.qml b/examples/charts/qmlchartsgallery/qml/BarSeriesHorizontal.qml
new file mode 100644
index 00000000..bfdd7cec
--- /dev/null
+++ b/examples/charts/qmlchartsgallery/qml/BarSeriesHorizontal.qml
@@ -0,0 +1,21 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+import QtQuick
+import QtCharts
+
+//![1]
+ChartView {
+ title: "Horizontal Bar Chart"
+ anchors.fill: parent
+ legend.alignment: Qt.AlignBottom
+ antialiasing: true
+
+ HorizontalBarSeries {
+ axisY: BarCategoryAxis { categories: ["2007", "2008", "2009", "2010", "2011", "2012" ] }
+ 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] }
+ }
+}
+//![1]