From 35f99173ba549d94cbb35535eecbd886bbe01630 Mon Sep 17 00:00:00 2001 From: Wolfgang Nagele Date: Mon, 11 Mar 2024 21:41:44 +0100 Subject: [PATCH] Device metrics chart improvements --- Meshtastic/Views/Nodes/DeviceMetricsLog.swift | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Meshtastic/Views/Nodes/DeviceMetricsLog.swift b/Meshtastic/Views/Nodes/DeviceMetricsLog.swift index e1e87b6a..269b3020 100644 --- a/Meshtastic/Views/Nodes/DeviceMetricsLog.swift +++ b/Meshtastic/Views/Nodes/DeviceMetricsLog.swift @@ -34,22 +34,25 @@ struct DeviceMetricsLog: View { Chart { ForEach(chartData, id: \.self) { point in - Plot { - LineMark( - x: .value("x", point.time!), - y: .value("y", point.batteryLevel) - ) + if point.batteryLevel != 101 { // Filter out magic charging value + Plot { + LineMark( + x: .value("x", point.time!), + y: .value("y", point.batteryLevel) + ) + } + .accessibilityLabel("Line Series") + .accessibilityValue("X: \(point.time!), Y: \(point.batteryLevel)") + .foregroundStyle(batteryChartColor) + .interpolationMethod(.linear) } - .accessibilityLabel("Line Series") - .accessibilityValue("X: \(point.time!), Y: \(point.batteryLevel)") - .foregroundStyle(batteryChartColor) - .interpolationMethod(.cardinal) Plot { PointMark( x: .value("x", point.time!), y: .value("y", point.channelUtilization) ) + .symbolSize(25) } .accessibilityLabel("Line Series") .accessibilityValue("X: \(point.time!), Y: \(point.channelUtilization)") @@ -64,6 +67,7 @@ struct DeviceMetricsLog: View { x: .value("x", point.time!), y: .value("y", point.airUtilTx) ) + .symbolSize(25) } .accessibilityLabel("Line Series") .accessibilityValue("X: \(point.time!), Y: \(point.airUtilTx)")