diff options
author | Juho Annunen <juho.annunen@qt.io> | 2018-04-17 13:57:22 +0300 |
---|---|---|
committer | Juho Annunen <juho.annunen@qt.io> | 2018-05-04 10:02:08 +0000 |
commit | 7c41444789be188fc47b3d68f4431d85d52d1e46 (patch) | |
tree | ce360465329abebd2b5535f10ae2cc9afc7d82d0 /basicsuite/enterprise-charts/View1.qml | |
parent | 2a50d497ef0e24732d5168d2d42c5d6bc27e23c6 (diff) |
Update Charts demo to new UI theme
Task-number: QTBUG-62792
Change-Id: I95c6fb038f5d427da2ed1ee6698e1afcfa436eee
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Diffstat (limited to 'basicsuite/enterprise-charts/View1.qml')
-rw-r--r-- | basicsuite/enterprise-charts/View1.qml | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/basicsuite/enterprise-charts/View1.qml b/basicsuite/enterprise-charts/View1.qml index 64aa78c..f85a18e 100644 --- a/basicsuite/enterprise-charts/View1.qml +++ b/basicsuite/enterprise-charts/View1.qml @@ -53,31 +53,30 @@ import QtQuick 2.0 //![2] import QtCharts 2.0 -Rectangle { +Item { anchors.fill: parent property variant othersSlice: 0 + //![1] - ChartView { + BaseChart { 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 } + PieSlice { label: "Volkswagen"; value: 13.5; color: defaultGreen } + PieSlice { label: "Toyota"; value: 10.9; color: mediumGreen } + PieSlice { label: "Ford"; value: 8.6; color: darkGreen } + PieSlice { label: "Skoda"; value: 8.2; color: defaultGrey } + PieSlice { label: "Volvo"; value: 6.8; color: secondaryGrey } } } Component.onCompleted: { // You can also manipulate slices dynamically othersSlice = pieSeries.append("Others", 52.0); + othersSlice.color = mediumGrey; pieSeries.find("Volkswagen").exploded = true; } //![1] |