Added display of network settings application status. Added axis indicators for the legend that contains information about the point

This commit is contained in:
Yury Shuvakin
2022-09-16 03:41:01 +03:00
parent 12c4535e06
commit dd63a2bf4c
7 changed files with 274 additions and 151 deletions

View File

@@ -24,6 +24,9 @@ ChartView {
property bool autoScaling: true
property int selectedSeriesIndex: 0
property string infoXMark: ""
property string infoYMark: ""
ValueAxis {
id: valueAxisX
min: 0
@@ -183,7 +186,7 @@ ChartView {
if (currentX < chart.series(selectedSeriesIndex).count && currentX > 0) {
selectedPoint = chart.series(selectedSeriesIndex).at(currentX)
currentPointInfoLabel.text = selectedPoint.x + ", " +selectedPoint.y
currentPointInfoLabel.text = selectedPoint.x + " " + infoXMark + ", " + selectedPoint.y + " " + infoYMark
} else {
currentPointInfo.visible = false
}

View File

@@ -148,6 +148,8 @@ ColumnLayout {
RowLayout {
property string xLabel: ""
property string yLabel: ""
property string infoXLabel: ""
property string infoYLabel: ""
property Controls.ChartView chart: chartView
property int seriesCount: 0
property bool horizontalLegend: true
@@ -165,6 +167,8 @@ ColumnLayout {
Controls.ChartView {
id: chartView
infoXMark: infoXLabel
infoYMark: infoYLabel
Layout.fillWidth: true
Layout.fillHeight: true
}
@@ -222,6 +226,8 @@ ColumnLayout {
Component.onCompleted: {
item.xLabel = Qt.binding(function() { return qsTr("Time, s") })
item.yLabel = Qt.binding(function() { return qsTr("Voltage, V") })
item.infoXLabel = Qt.binding(function() { return qsTr("s") })
item.infoYLabel = Qt.binding(function() { return qsTr("V") })
}
}
@@ -235,6 +241,8 @@ ColumnLayout {
Component.onCompleted: {
item.xLabel = Qt.binding(function() { return qsTr("Time, s") })
item.yLabel = Qt.binding(function() { return qsTr("Current, A") })
item.infoXLabel = Qt.binding(function() { return qsTr("s") })
item.infoYLabel = Qt.binding(function() { return qsTr("A") })
}
}
@@ -248,6 +256,8 @@ ColumnLayout {
Component.onCompleted: {
item.xLabel = Qt.binding(function() { return qsTr("Time, s") })
item.yLabel = Qt.binding(function() { return qsTr("Temperature, °C") })
item.infoXLabel = Qt.binding(function() { return qsTr("s") })
item.infoYLabel = Qt.binding(function() { return qsTr("°C") })
}
}
@@ -261,6 +271,8 @@ ColumnLayout {
Component.onCompleted: {
item.xLabel = Qt.binding(function() { return qsTr("Time, s") })
item.yLabel = Qt.binding(function() { return qsTr("Temperature, °C") })
item.infoXLabel = Qt.binding(function() { return qsTr("s") })
item.infoYLabel = Qt.binding(function() { return qsTr("°C") })
}
}
@@ -274,6 +286,8 @@ ColumnLayout {
Component.onCompleted: {
item.xLabel = Qt.binding(function() { return qsTr("Time, s") })
item.yLabel = Qt.binding(function() { return qsTr("Voltage, V") })
item.infoXLabel = Qt.binding(function() { return qsTr("s") })
item.infoYLabel = Qt.binding(function() { return qsTr("V") })
}
}
@@ -287,6 +301,8 @@ ColumnLayout {
Component.onCompleted: {
item.xLabel = Qt.binding(function() { return qsTr("Time, s") })
item.yLabel = Qt.binding(function() { return qsTr("Voltage, V") })
item.infoXLabel = Qt.binding(function() { return qsTr("s") })
item.infoYLabel = Qt.binding(function() { return qsTr("V") })
item.horizontalLegend = false
}
}