FluentUI/example/qml/chart/T_LineChart.qml

46 lines
1.3 KiB
QML
Raw Normal View History

2023-12-05 11:42:21 +08:00
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import FluentUI 1.0
import "../component"
FluScrollablePage{
2024-03-09 18:26:54 +08:00
title: qsTr("Line Chart")
2023-12-05 11:42:21 +08:00
2024-03-29 16:56:09 +08:00
FluFrame{
2024-03-29 16:23:16 +08:00
Layout.preferredWidth: 500
Layout.preferredHeight: 370
padding: 10
2023-12-05 11:42:21 +08:00
Layout.topMargin: 20
FluChart{
anchors.fill: parent
chartType: 'line'
chartData: { return {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
datasets: [{
label: 'My First Dataset',
data: [65, 59, 80, 81, 56, 55, 40],
fill: false,
borderColor: 'rgb(75, 192, 192)',
tension: 0.1
}]
}
}
chartOptions: { return {
maintainAspectRatio: false,
title: {
display: true,
text: 'Chart.js Line Chart - Stacked'
},
tooltips: {
mode: 'index',
intersect: false
}
}
}
}
}
}