Compare commits

...

2 Commits

Author SHA1 Message Date
朱子楚\zhuzi
655eff4f62 update 2024-05-07 22:16:42 +08:00
朱子楚\zhuzi
b916221d9f update 2024-05-07 21:47:40 +08:00
7 changed files with 30 additions and 21 deletions

View File

@ -1402,7 +1402,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
<context>
<name>T_LineChart</name>
<message>
<location filename="qml/chart/T_LineChart.qml" line="10"/>
<location filename="qml/chart/T_LineChart.qml" line="11"/>
<source>Line Chart</source>
<translation type="unfinished"></translation>
</message>

View File

@ -1500,7 +1500,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
<context>
<name>T_LineChart</name>
<message>
<location filename="qml/chart/T_LineChart.qml" line="10"/>
<location filename="qml/chart/T_LineChart.qml" line="11"/>
<source>Line Chart</source>
<translation type="unfinished">线</translation>
</message>

View File

@ -7,7 +7,9 @@ import "../component"
FluScrollablePage{
id: root
title: qsTr("Line Chart")
property var data : []
FluFrame{
Layout.preferredWidth: 500
@ -15,13 +17,14 @@ FluScrollablePage{
padding: 10
Layout.topMargin: 20
FluChart{
id: chart
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],
data: root.data,
fill: false,
borderColor: 'rgb(75, 192, 192)',
tension: 0.1
@ -41,5 +44,20 @@ FluScrollablePage{
}
}
}
Timer{
id: timer
interval: 300
repeat: true
onTriggered: {
root.data.push(Math.random()*100)
if(root.data.length>7){
root.data.shift()
}
chart.animateToNewData()
}
}
Component.onCompleted: {
timer.restart()
}
}
}

View File

@ -164,7 +164,7 @@ FluScrollablePage{
verticalCenter: parent.verticalCenter
left: parent.left
}
currentIndex: 1
currentIndex: -1
FluCheckBox{
disabled: radio_button_switch4.checked
text: qsTr("Radio Button_1")

View File

@ -8,7 +8,6 @@
class FluTableModel : public QAbstractTableModel {
Q_OBJECT
Q_PROPERTY_AUTO(int, dataSourceSize)
Q_PROPERTY_AUTO(QList<QVariantMap>, columnSource)
Q_PROPERTY_AUTO(QList<QVariantMap>, rows)
Q_PROPERTY(int rowCount READ rowCount CONSTANT)

View File

@ -18,7 +18,9 @@ Item{
for(var i = 0;i<buttons.length;i++){
buttons[i].checked = false
}
buttons[currentIndex].checked = true
if(currentIndex>=0 && currentIndex<buttons.length){
buttons[currentIndex].checked = true
}
}
}
implicitWidth: childrenRect.width
@ -42,9 +44,6 @@ Item{
}
}
}
if(control.currentIndex < 0){
control.currentIndex = 0
}
d.updateChecked()
}
}
@ -52,7 +51,7 @@ Item{
Component{
id:com_horizontal
RowLayout {
data: buttons
data: control.buttons
spacing: control.spacing
Component.onCompleted: {
for(var i = 0;i<control.buttons.length;i++){
@ -65,9 +64,6 @@ Item{
}
}
}
if(control.currentIndex < 0){
control.currentIndex = 0
}
d.updateChecked()
}
}

View File

@ -19,7 +19,9 @@ Item{
for(var i = 0;i<buttons.length;i++){
buttons[i].checked = false
}
buttons[currentIndex].checked = true
if(currentIndex>=0 && currentIndex<buttons.length){
buttons[currentIndex].checked = true
}
}
}
implicitWidth: childrenRect.width
@ -43,9 +45,6 @@ Item{
}
}
}
if(control.currentIndex < 0){
control.currentIndex = 0
}
d.updateChecked()
}
}
@ -53,7 +52,7 @@ Item{
Component{
id:com_horizontal
RowLayout {
data: buttons
data: control.buttons
spacing: control.spacing
Component.onCompleted: {
for(var i = 0;i<control.buttons.length;i++){
@ -66,9 +65,6 @@ Item{
}
}
}
if(control.currentIndex < 0){
control.currentIndex = 0
}
d.updateChecked()
}
}