From 7196460986361623677b76bc228dd9887a68368a Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Thu, 30 Jan 2014 14:05:48 +0100 Subject: Add Qt Charts demos to the qtlauncher This change depends on a2f0bd6002708aa0c782684ca6e6982e6e766015 in b2qt-launcher. Change-Id: If76be005a905546e9c474d6597dffeeb095f97f8 Reviewed-by: Eirik Aavitsland --- basicsuite/enterprise-charts/View1.qml | 54 +++++++++++++ basicsuite/enterprise-charts/View10.qml | 42 +++++++++++ basicsuite/enterprise-charts/View11.qml | 43 +++++++++++ basicsuite/enterprise-charts/View12.qml | 68 +++++++++++++++++ basicsuite/enterprise-charts/View13.qml | 87 +++++++++++++++++++++ basicsuite/enterprise-charts/View14.qml | 74 ++++++++++++++++++ basicsuite/enterprise-charts/View15.qml | 77 +++++++++++++++++++ basicsuite/enterprise-charts/View2.qml | 45 +++++++++++ basicsuite/enterprise-charts/View3.qml | 45 +++++++++++ basicsuite/enterprise-charts/View4.qml | 109 +++++++++++++++++++++++++++ basicsuite/enterprise-charts/View5.qml | 57 ++++++++++++++ basicsuite/enterprise-charts/View6.qml | 43 +++++++++++ basicsuite/enterprise-charts/View7.qml | 43 +++++++++++ basicsuite/enterprise-charts/View8.qml | 42 +++++++++++ basicsuite/enterprise-charts/View9.qml | 43 +++++++++++ basicsuite/enterprise-charts/description.txt | 3 + basicsuite/enterprise-charts/loader.qml | 37 +++++++++ basicsuite/enterprise-charts/main.qml | 92 ++++++++++++++++++++++ basicsuite/enterprise-charts/preview_l.jpg | Bin 0 -> 11070 bytes basicsuite/enterprise-charts/title.txt | 1 + 20 files changed, 1005 insertions(+) create mode 100644 basicsuite/enterprise-charts/View1.qml create mode 100644 basicsuite/enterprise-charts/View10.qml create mode 100644 basicsuite/enterprise-charts/View11.qml create mode 100644 basicsuite/enterprise-charts/View12.qml create mode 100644 basicsuite/enterprise-charts/View13.qml create mode 100644 basicsuite/enterprise-charts/View14.qml create mode 100644 basicsuite/enterprise-charts/View15.qml create mode 100644 basicsuite/enterprise-charts/View2.qml create mode 100644 basicsuite/enterprise-charts/View3.qml create mode 100644 basicsuite/enterprise-charts/View4.qml create mode 100644 basicsuite/enterprise-charts/View5.qml create mode 100644 basicsuite/enterprise-charts/View6.qml create mode 100644 basicsuite/enterprise-charts/View7.qml create mode 100644 basicsuite/enterprise-charts/View8.qml create mode 100644 basicsuite/enterprise-charts/View9.qml create mode 100644 basicsuite/enterprise-charts/description.txt create mode 100644 basicsuite/enterprise-charts/loader.qml create mode 100644 basicsuite/enterprise-charts/main.qml create mode 100644 basicsuite/enterprise-charts/preview_l.jpg create mode 100644 basicsuite/enterprise-charts/title.txt diff --git a/basicsuite/enterprise-charts/View1.qml b/basicsuite/enterprise-charts/View1.qml new file mode 100644 index 0000000..308cacd --- /dev/null +++ b/basicsuite/enterprise-charts/View1.qml @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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 Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise 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$ +** +****************************************************************************/ + +//![2] +import QtQuick 2.0 +//![2] +import QtCommercial.Chart 1.1 + +Rectangle { + anchors.fill: parent + property variant othersSlice: 0 + + //![1] + ChartView { + id: chart + title: "Top-5 car brand shares in Finland" + anchors.fill: parent + legend.alignment: Qt.AlignBottom + antialiasing: true + + PieSeries { + id: pieSeries + PieSlice { label: "Volkswagen"; value: 13.5 } + PieSlice { label: "Toyota"; value: 10.9 } + PieSlice { label: "Ford"; value: 8.6 } + PieSlice { label: "Skoda"; value: 8.2 } + PieSlice { label: "Volvo"; value: 6.8 } + } + } + + Component.onCompleted: { + // You can also manipulate slices dynamically + othersSlice = pieSeries.append("Others", 52.0); + pieSeries.find("Volkswagen").exploded = true; + } + //![1] +} diff --git a/basicsuite/enterprise-charts/View10.qml b/basicsuite/enterprise-charts/View10.qml new file mode 100644 index 0000000..2074b70 --- /dev/null +++ b/basicsuite/enterprise-charts/View10.qml @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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 Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise 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 2.0 +import QtCommercial.Chart 1.1 + +Rectangle { + anchors.fill: parent + + //![1] + ChartView { + title: "Horizontal Stacked Bar series" + anchors.fill: parent + legend.alignment: Qt.AlignBottom + antialiasing: true + + HorizontalStackedBarSeries { + 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] +} diff --git a/basicsuite/enterprise-charts/View11.qml b/basicsuite/enterprise-charts/View11.qml new file mode 100644 index 0000000..27166fa --- /dev/null +++ b/basicsuite/enterprise-charts/View11.qml @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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 Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise 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 2.0 +import QtCommercial.Chart 1.1 + +Rectangle { + anchors.fill: parent + + //![1] + ChartView { + title: "Horizontal Percent Bar series" + anchors.fill: parent + legend.alignment: Qt.AlignBottom + antialiasing: true + + HorizontalPercentBarSeries { + 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] +} + diff --git a/basicsuite/enterprise-charts/View12.qml b/basicsuite/enterprise-charts/View12.qml new file mode 100644 index 0000000..4bf89aa --- /dev/null +++ b/basicsuite/enterprise-charts/View12.qml @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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 Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise 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 2.0 +import QtCommercial.Chart 1.3 + +Rectangle { + anchors.fill: parent + //![1] + PolarChartView { + title: "Two Series, Common Axes" + anchors.fill: parent + legend.visible: false + + ValueAxis { + id: axisAngular + min: 0 + max: 20 + tickCount: 9 + } + + ValueAxis { + id: axisRadial + min: -0.5 + max: 1.5 + } + + SplineSeries { + id: series1 + axisAngular: axisAngular + axisRadial: axisRadial + pointsVisible: true + } + + ScatterSeries { + id: series2 + axisAngular: axisAngular + axisRadial: axisRadial + markerSize: 10 + } + } + + // Add data dynamically to the series + Component.onCompleted: { + for (var i = 0; i <= 20; i++) { + series1.append(i, Math.random()); + series2.append(i, Math.random()); + } + } + //![1] +} diff --git a/basicsuite/enterprise-charts/View13.qml b/basicsuite/enterprise-charts/View13.qml new file mode 100644 index 0000000..1f6aec1 --- /dev/null +++ b/basicsuite/enterprise-charts/View13.qml @@ -0,0 +1,87 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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 Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise 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 2.0 +import QtCommercial.Chart 1.3 + +Rectangle { + anchors.fill: parent + + PolarChartView { + title: "Historical Area Series" + anchors.fill: parent + legend.visible: false + + DateTimeAxis { + id: axis1 + format: "yyyy MMM" + tickCount: 13 + } + ValueAxis { + id: axis2 + } + LineSeries { + id: lowerLine + axisAngular: axis1 + axisRadial: axis2 + + // Please note that month in JavaScript months are zero based, so 2 means March + XYPoint { x: toMsecsSinceEpoch(new Date(1950, 0, 1)); y: 15 } + XYPoint { x: toMsecsSinceEpoch(new Date(1962, 4, 1)); y: 35 } + XYPoint { x: toMsecsSinceEpoch(new Date(1970, 0, 1)); y: 50 } + XYPoint { x: toMsecsSinceEpoch(new Date(1978, 2, 1)); y: 75 } + XYPoint { x: toMsecsSinceEpoch(new Date(1987, 11, 1)); y: 102 } + XYPoint { x: toMsecsSinceEpoch(new Date(1992, 1, 1)); y: 132 } + XYPoint { x: toMsecsSinceEpoch(new Date(1998, 7, 1)); y: 100 } + XYPoint { x: toMsecsSinceEpoch(new Date(2002, 4, 1)); y: 120 } + XYPoint { x: toMsecsSinceEpoch(new Date(2012, 8, 1)); y: 140 } + XYPoint { x: toMsecsSinceEpoch(new Date(2013, 5, 1)); y: 150 } + } + LineSeries { + id: upperLine + axisAngular: axis1 + axisRadial: axis2 + + // Please note that month in JavaScript months are zero based, so 2 means March + XYPoint { x: toMsecsSinceEpoch(new Date(1950, 0, 1)); y: 30 } + XYPoint { x: toMsecsSinceEpoch(new Date(1962, 4, 1)); y: 55 } + XYPoint { x: toMsecsSinceEpoch(new Date(1970, 0, 1)); y: 80 } + XYPoint { x: toMsecsSinceEpoch(new Date(1978, 2, 1)); y: 105 } + XYPoint { x: toMsecsSinceEpoch(new Date(1987, 11, 1)); y: 125 } + XYPoint { x: toMsecsSinceEpoch(new Date(1992, 1, 1)); y: 160 } + XYPoint { x: toMsecsSinceEpoch(new Date(1998, 7, 1)); y: 140 } + XYPoint { x: toMsecsSinceEpoch(new Date(2002, 4, 1)); y: 140 } + XYPoint { x: toMsecsSinceEpoch(new Date(2012, 8, 1)); y: 170 } + XYPoint { x: toMsecsSinceEpoch(new Date(2013, 5, 1)); y: 200 } + } + AreaSeries { + axisAngular: axis1 + axisRadial: axis2 + lowerSeries: lowerLine + upperSeries: upperLine + } + } + // DateTimeAxis is based on QDateTimes so we must convert our JavaScript dates to + // milliseconds since epoch to make them match the DateTimeAxis values + function toMsecsSinceEpoch(date) { + var msecs = date.getTime(); + return msecs; + } +} diff --git a/basicsuite/enterprise-charts/View14.qml b/basicsuite/enterprise-charts/View14.qml new file mode 100644 index 0000000..bae0e8a --- /dev/null +++ b/basicsuite/enterprise-charts/View14.qml @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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 Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise 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 2.0 +import QtCommercial.Chart 1.3 + +Rectangle { + anchors.fill: parent + + PolarChartView { + title: "Numerical Data for Dummies" + anchors.fill: parent + legend.visible: false + + LineSeries { + axisRadial: CategoryAxis { + min: 0 + max: 30 + CategoryRange { + label: "critical" + endValue: 2 + } + CategoryRange { + label: "low" + endValue: 7 + } + CategoryRange { + label: "normal" + endValue: 12 + } + CategoryRange { + label: "high" + endValue: 18 + } + CategoryRange { + label: "extremely high" + endValue: 30 + } + } + + axisAngular: ValueAxis { + tickCount: 13 + } + + XYPoint { x: 0; y: 4.3 } + XYPoint { x: 1; y: 4.1 } + XYPoint { x: 2; y: 4.7 } + XYPoint { x: 3; y: 3.9 } + XYPoint { x: 4; y: 5.2 } + XYPoint { x: 5; y: 5.3 } + XYPoint { x: 6; y: 6.1 } + XYPoint { x: 7; y: 7.7 } + XYPoint { x: 8; y: 12.9 } + XYPoint { x: 9; y: 19.2 } + } + } +} diff --git a/basicsuite/enterprise-charts/View15.qml b/basicsuite/enterprise-charts/View15.qml new file mode 100644 index 0000000..57db474 --- /dev/null +++ b/basicsuite/enterprise-charts/View15.qml @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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 Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise 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 2.0 +import QtCommercial.Chart 1.1 + +Rectangle { + anchors.fill: parent + + //![1] + ChartView { + id: chart + title: "Production costs" + anchors.fill: parent + legend.visible: false + antialiasing: true + + PieSeries { + id: pieOuter + size: 0.96 + holeSize: 0.7 + PieSlice { id: slice; label: "Alpha"; value: 19511; color: "#8AB846"; borderColor: "#163430" } + PieSlice { label: "Epsilon"; value: 11105; color: "#C0EEFF"; borderColor: "#3B391C" } + PieSlice { label: "Psi"; value: 9352; color: "#DF8939"; borderColor: "#13060C" } + } + + PieSeries { + size: 0.7 + id: pieInner + holeSize: 0.25 + + PieSlice { label: "Materials"; value: 10334; color: "#8AB846"; borderColor: "#163430" } + PieSlice { label: "Employee"; value: 3066; color: "#AAE356"; borderColor: "#163430" } + PieSlice { label: "Logistics"; value: 6111; color: "#99CC4E"; borderColor: "#163430" } + + PieSlice { label: "Materials"; value: 7371; color: "#C0EEFF"; borderColor: "#3B391C" } + PieSlice { label: "Employee"; value: 2443; color: "#C9FAFF"; borderColor: "#3B391C" } + PieSlice { label: "Logistics"; value: 1291; color: "#B0FAFF"; borderColor: "#3B391C" } + + PieSlice { label: "Materials"; value: 4022; color: "#DF8939"; borderColor: "#13060C" } + PieSlice { label: "Employee"; value: 3998; color: "#FC9D42"; borderColor: "#13060C" } + PieSlice { label: "Logistics"; value: 1332; color: "#F2963F"; borderColor: "#13060C" } + } + } + + Component.onCompleted: { + // Set the common slice properties dynamically for convenience + for (var i = 0; i < pieOuter.count; i++) { + pieOuter.at(i).labelPosition = PieSlice.LabelOutside; + pieOuter.at(i).labelVisible = true; + pieOuter.at(i).borderWidth = 3; + } + for (var i = 0; i < pieInner.count; i++) { + pieInner.at(i).labelPosition = PieSlice.LabelInsideNormal; + pieInner.at(i).labelVisible = true; + pieInner.at(i).borderWidth = 2; + } + } + //![1] +} diff --git a/basicsuite/enterprise-charts/View2.qml b/basicsuite/enterprise-charts/View2.qml new file mode 100644 index 0000000..698bd2d --- /dev/null +++ b/basicsuite/enterprise-charts/View2.qml @@ -0,0 +1,45 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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 Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise 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 2.0 +import QtCommercial.Chart 1.1 + +Rectangle { + anchors.fill: parent + + //![1] + ChartView { + title: "Line" + anchors.fill: parent + antialiasing: true + + LineSeries { + name: "LineSeries" + XYPoint { x: 0; y: 0 } + XYPoint { x: 1.1; y: 2.1 } + XYPoint { x: 1.9; y: 3.3 } + XYPoint { x: 2.1; y: 2.1 } + XYPoint { x: 2.9; y: 4.9 } + XYPoint { x: 3.4; y: 3.0 } + XYPoint { x: 4.1; y: 3.3 } + } + } + //![1] +} diff --git a/basicsuite/enterprise-charts/View3.qml b/basicsuite/enterprise-charts/View3.qml new file mode 100644 index 0000000..88974de --- /dev/null +++ b/basicsuite/enterprise-charts/View3.qml @@ -0,0 +1,45 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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 Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise 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 2.0 +import QtCommercial.Chart 1.1 + +Rectangle { + anchors.fill: parent + + //![1] + ChartView { + title: "Spline" + anchors.fill: parent + antialiasing: true + + SplineSeries { + name: "SplineSeries" + XYPoint { x: 0; y: 0.0 } + XYPoint { x: 1.1; y: 3.2 } + XYPoint { x: 1.9; y: 2.4 } + XYPoint { x: 2.1; y: 2.1 } + XYPoint { x: 2.9; y: 2.6 } + XYPoint { x: 3.4; y: 2.3 } + XYPoint { x: 4.1; y: 3.1 } + } + } + //![1] +} diff --git a/basicsuite/enterprise-charts/View4.qml b/basicsuite/enterprise-charts/View4.qml new file mode 100644 index 0000000..fc5c539 --- /dev/null +++ b/basicsuite/enterprise-charts/View4.qml @@ -0,0 +1,109 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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 Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise 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 2.0 +import QtCommercial.Chart 1.1 + +Rectangle { + anchors.fill: parent + + //![1] + ChartView { + title: "NHL All-Star Team Players" + anchors.fill: parent + antialiasing: true + + ValueAxis { + id: valueAxis + min: 2000 + max: 2011 + tickCount: 12 + labelFormat: "%.0f" + } + + AreaSeries { + name: "Russian" + color: "#FFD52B1E" + borderColor: "#FF0039A5" + borderWidth: 3 + axisX: valueAxis + upperSeries: LineSeries { + XYPoint { x: 2000; y: 1 } + XYPoint { x: 2001; y: 1 } + XYPoint { x: 2002; y: 1 } + XYPoint { x: 2003; y: 1 } + XYPoint { x: 2004; y: 1 } + XYPoint { x: 2005; y: 0 } + XYPoint { x: 2006; y: 1 } + XYPoint { x: 2007; y: 1 } + XYPoint { x: 2008; y: 4 } + XYPoint { x: 2009; y: 3 } + XYPoint { x: 2010; y: 2 } + XYPoint { x: 2011; y: 1 } + } + } + // ... + //![1] + + AreaSeries { + name: "Swedish" + color: "#AF005292" + borderColor: "#AFFDCA00" + borderWidth: 3 + axisX: valueAxis + upperSeries: LineSeries { + XYPoint { x: 2000; y: 1 } + XYPoint { x: 2001; y: 1 } + XYPoint { x: 2002; y: 3 } + XYPoint { x: 2003; y: 3 } + XYPoint { x: 2004; y: 2 } + XYPoint { x: 2005; y: 0 } + XYPoint { x: 2006; y: 2 } + XYPoint { x: 2007; y: 1 } + XYPoint { x: 2008; y: 2 } + XYPoint { x: 2009; y: 1 } + XYPoint { x: 2010; y: 3 } + XYPoint { x: 2011; y: 3 } + } + } + + AreaSeries { + name: "Finnish" + color: "#00357F" + borderColor: "#FEFEFE" + borderWidth: 3 + axisX: valueAxis + upperSeries: LineSeries { + XYPoint { x: 2000; y: 0 } + XYPoint { x: 2001; y: 0 } + XYPoint { x: 2002; y: 0 } + XYPoint { x: 2003; y: 0 } + XYPoint { x: 2004; y: 0 } + XYPoint { x: 2005; y: 0 } + XYPoint { x: 2006; y: 1 } + XYPoint { x: 2007; y: 0 } + XYPoint { x: 2008; y: 0 } + XYPoint { x: 2009; y: 0 } + XYPoint { x: 2010; y: 0 } + XYPoint { x: 2011; y: 1 } + } + } + } +} diff --git a/basicsuite/enterprise-charts/View5.qml b/basicsuite/enterprise-charts/View5.qml new file mode 100644 index 0000000..6077816 --- /dev/null +++ b/basicsuite/enterprise-charts/View5.qml @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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 Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise 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 2.0 +import QtCommercial.Chart 1.1 + +Rectangle { + anchors.fill: parent + + //![1] + ChartView { + title: "Scatters" + anchors.fill: parent + antialiasing: true + + ScatterSeries { + id: scatter1 + name: "Scatter1" + XYPoint { x: 1.5; y: 1.5 } + XYPoint { x: 1.5; y: 1.6 } + XYPoint { x: 1.57; y: 1.55 } + XYPoint { x: 1.8; y: 1.8 } + XYPoint { x: 1.9; y: 1.6 } + XYPoint { x: 2.1; y: 1.3 } + XYPoint { x: 2.5; y: 2.1 } + } + + ScatterSeries { + name: "Scatter2" + // ... + //![1] + XYPoint { x: 2.0; y: 2.0 } + XYPoint { x: 2.0; y: 2.1 } + XYPoint { x: 2.07; y: 2.05 } + XYPoint { x: 2.2; y: 2.9 } + XYPoint { x: 2.4; y: 2.7 } + XYPoint { x: 2.67; y: 2.65 } + } + } +} diff --git a/basicsuite/enterprise-charts/View6.qml b/basicsuite/enterprise-charts/View6.qml new file mode 100644 index 0000000..1ce795a --- /dev/null +++ b/basicsuite/enterprise-charts/View6.qml @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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 Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise 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 2.0 +import QtCommercial.Chart 1.1 + +Rectangle { + anchors.fill: parent + + //![1] + ChartView { + title: "Bar series" + anchors.fill: parent + legend.alignment: Qt.AlignBottom + antialiasing: true + + BarSeries { + id: mySeries + axisX: 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] +} diff --git a/basicsuite/enterprise-charts/View7.qml b/basicsuite/enterprise-charts/View7.qml new file mode 100644 index 0000000..99776b7 --- /dev/null +++ b/basicsuite/enterprise-charts/View7.qml @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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 Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise 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 2.0 +import QtCommercial.Chart 1.1 + +Rectangle { + anchors.fill: parent + + //![1] + ChartView { + title: "Stacked Bar series" + anchors.fill: parent + legend.alignment: Qt.AlignBottom + antialiasing: true + + StackedBarSeries { + id: mySeries + axisX: 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] +} diff --git a/basicsuite/enterprise-charts/View8.qml b/basicsuite/enterprise-charts/View8.qml new file mode 100644 index 0000000..cad360d --- /dev/null +++ b/basicsuite/enterprise-charts/View8.qml @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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 Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise 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 2.0 +import QtCommercial.Chart 1.1 + +Rectangle { + anchors.fill: parent + + //![1] + ChartView { + title: "Percent Bar series" + anchors.fill: parent + legend.alignment: Qt.AlignBottom + antialiasing: true + + PercentBarSeries { + axisX: 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] +} diff --git a/basicsuite/enterprise-charts/View9.qml b/basicsuite/enterprise-charts/View9.qml new file mode 100644 index 0000000..0f5796d --- /dev/null +++ b/basicsuite/enterprise-charts/View9.qml @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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 Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise 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 2.0 +import QtCommercial.Chart 1.1 + +Rectangle { + anchors.fill: parent + + //![1] + ChartView { + title: "Horizontal Bar series" + 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] +} + diff --git a/basicsuite/enterprise-charts/description.txt b/basicsuite/enterprise-charts/description.txt new file mode 100644 index 0000000..6c8d488 --- /dev/null +++ b/basicsuite/enterprise-charts/description.txt @@ -0,0 +1,3 @@ +This demo presents different types of charts that are available from Qt Charts library. + +Qt Charts is part of the Qt Enterprise addons package which provides a set of easy to use chart components. It uses the Qt Graphics View Framework, therefore charts can be easily integrated to modern user interfaces. Qt Charts can be used as QWidgets, QGraphicsWidget, or QML types. diff --git a/basicsuite/enterprise-charts/loader.qml b/basicsuite/enterprise-charts/loader.qml new file mode 100644 index 0000000..080fce6 --- /dev/null +++ b/basicsuite/enterprise-charts/loader.qml @@ -0,0 +1,37 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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 Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise 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 2.0 + +Item { + id: container + width: 600 + height: 400 + Component.onCompleted: { + var co = Qt.createComponent("main.qml") + if (co.status == Component.Ready) { + var o = co.createObject(container) + } else { + console.log(co.errorString()) + console.log("QtCommercial.Chart 1.1 not available") + console.log("Please use correct QML_IMPORT_PATH export") + } + } +} diff --git a/basicsuite/enterprise-charts/main.qml b/basicsuite/enterprise-charts/main.qml new file mode 100644 index 0000000..b3c02e3 --- /dev/null +++ b/basicsuite/enterprise-charts/main.qml @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Copyright (C) 2013 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 Enterprise Charts Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Enterprise licenses may use this file in +** accordance with the Qt Enterprise 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$ +** +****************************************************************************/ + +//![1] +import QtQuick 2.0 +//![1] + +Rectangle { + width: 600 + height: 400 + property int viewNumber: 1 + + Loader { + id: loader + anchors.fill: parent + source: "View" + viewNumber + ".qml"; + } + + Rectangle { + id: infoText + anchors.centerIn: parent + width: parent.width + height: 40 + color: "black" + Text { + color: "white" + anchors.centerIn: parent + text: "Use left and right arrow keys or tap on the screen to navigate between chart types" + } + + Behavior on opacity { + NumberAnimation { duration: 400 } + } + } + + MouseArea { + focus: true + anchors.fill: parent + onClicked: { + if (infoText.opacity > 0) { + infoText.opacity = 0.0; + } else { + nextView(); + } + } + Keys.onPressed: { + if (infoText.opacity > 0) { + infoText.opacity = 0.0; + } else { + if (event.key == Qt.Key_Left) { + previousView(); + } else { + // tapping on the screen advances to the next view + nextView(); + } + } + } + } + + function nextView() { + var i = viewNumber + 1; + if (i > 15) + viewNumber = 1; + else + viewNumber = i; + } + + function previousView() { + var i = viewNumber - 1; + if (i <= 0) + viewNumber = 15; + else + viewNumber = i; + } +} diff --git a/basicsuite/enterprise-charts/preview_l.jpg b/basicsuite/enterprise-charts/preview_l.jpg new file mode 100644 index 0000000..2776b0b Binary files /dev/null and b/basicsuite/enterprise-charts/preview_l.jpg differ diff --git a/basicsuite/enterprise-charts/title.txt b/basicsuite/enterprise-charts/title.txt new file mode 100644 index 0000000..d3ce063 --- /dev/null +++ b/basicsuite/enterprise-charts/title.txt @@ -0,0 +1 @@ +Qt Charts - Gallery -- cgit v1.2.3