mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-11-27 21:58:42 +08:00
95 lines
2.7 KiB
QML
95 lines
2.7 KiB
QML
|
import QtQuick 2.15
|
||
|
import QtQuick.Layouts 1.15
|
||
|
import QtQuick.Window 2.15
|
||
|
import QtQuick.Controls 2.15
|
||
|
import FluentUI 1.0
|
||
|
import "qrc:///example/qml/component"
|
||
|
import "../component"
|
||
|
|
||
|
FluScrollablePage{
|
||
|
|
||
|
title:"Doughnut and Pie Chart"
|
||
|
|
||
|
FluArea{
|
||
|
width: 500
|
||
|
height: 370
|
||
|
paddings: 10
|
||
|
Layout.topMargin: 20
|
||
|
FluChart{
|
||
|
anchors.fill: parent
|
||
|
chartType: "doughnut"
|
||
|
chartData: { return {
|
||
|
labels: [
|
||
|
'Red',
|
||
|
'Blue',
|
||
|
'Yellow'
|
||
|
],
|
||
|
datasets: [{
|
||
|
label: 'My First Dataset',
|
||
|
data: [300, 50, 100],
|
||
|
backgroundColor: [
|
||
|
'rgb(255, 99, 132)',
|
||
|
'rgb(54, 162, 235)',
|
||
|
'rgb(255, 205, 86)'
|
||
|
],
|
||
|
hoverOffset: 4
|
||
|
}]
|
||
|
}
|
||
|
}
|
||
|
chartOptions: { return {
|
||
|
maintainAspectRatio: false,
|
||
|
title: {
|
||
|
display: true,
|
||
|
text: 'Chart.js Doughnut Chart - Stacked'
|
||
|
},
|
||
|
tooltips: {
|
||
|
mode: 'index',
|
||
|
intersect: false
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
FluArea{
|
||
|
width: 500
|
||
|
height: 370
|
||
|
paddings: 10
|
||
|
Layout.topMargin: 20
|
||
|
FluChart{
|
||
|
anchors.fill: parent
|
||
|
chartType: "pie"
|
||
|
chartData: { return {
|
||
|
labels: [
|
||
|
'Red',
|
||
|
'Blue',
|
||
|
'Yellow'
|
||
|
],
|
||
|
datasets: [{
|
||
|
label: 'My First Dataset',
|
||
|
data: [300, 50, 100],
|
||
|
backgroundColor: [
|
||
|
'rgb(255, 99, 132)',
|
||
|
'rgb(54, 162, 235)',
|
||
|
'rgb(255, 205, 86)'
|
||
|
],
|
||
|
hoverOffset: 4
|
||
|
}]
|
||
|
}
|
||
|
}
|
||
|
chartOptions: { return {
|
||
|
maintainAspectRatio: false,
|
||
|
title: {
|
||
|
display: true,
|
||
|
text: 'Chart.js Pie Chart - Stacked'
|
||
|
},
|
||
|
tooltips: {
|
||
|
mode: 'index',
|
||
|
intersect: false
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|