refactor: order Minimum, Messwert und Maximum, sowie Durchschnitt

This commit is contained in:
ISA
2025-07-23 08:07:12 +02:00
parent 5a0188c635
commit 36863d3c6a
6 changed files with 42 additions and 33 deletions

View File

@@ -185,20 +185,7 @@ export default function AnalogInputsChart() {
? zeitraum === "DIA0"
? [
{
label: selectedAnalogInput?.label
? `Messwert (m) ${selectedAnalogInput.label}`
: "Messwert (m)",
data: filteredData
.filter((p) => typeof p.m === "number")
.map((p) => ({ x: new Date(p.t), y: p.m })),
borderColor: getColor("littwin-blue"),
backgroundColor: "rgba(59,130,246,0.3)",
borderWidth: 2,
pointRadius: 0,
tension: 0.1,
},
{
label: "Minimum (i)",
label: "Minimum ", // (i)
data: filteredData
.filter((p) => typeof p.i === "number")
.map((p) => ({ x: new Date(p.t), y: p.i })),
@@ -209,7 +196,21 @@ export default function AnalogInputsChart() {
tension: 0.1,
},
{
label: "Maximum (a)",
label: selectedAnalogInput?.label
? //? `Messwert ${selectedAnalogInput.label}` // (m)
`Messwert ` // (m)
: "Messwert ", // (m)
data: filteredData
.filter((p) => typeof p.m === "number")
.map((p) => ({ x: new Date(p.t), y: p.m })),
borderColor: getColor("littwin-blue"),
backgroundColor: "rgba(59,130,246,0.3)",
borderWidth: 2,
pointRadius: 0,
tension: 0.1,
},
{
label: "Maximum ", // (a)
data: filteredData
.filter((p) => typeof p.a === "number")
.map((p) => ({ x: new Date(p.t), y: p.a })),
@@ -222,7 +223,7 @@ export default function AnalogInputsChart() {
]
: [
{
label: "Minimum (i)",
label: "Minimum", // (i)
data: filteredData
.filter((p) => typeof p.i === "number")
.map((p) => ({ x: new Date(p.t), y: p.i })),
@@ -233,18 +234,7 @@ export default function AnalogInputsChart() {
tension: 0.1,
},
{
label: "Maximum (a)",
data: filteredData
.filter((p) => typeof p.a === "number")
.map((p) => ({ x: new Date(p.t), y: p.a })),
borderColor: "gray",
borderDash: [4, 2],
borderWidth: 1,
pointRadius: 0,
tension: 0.1,
},
{
label: "Durchschnitt (g)",
label: "Durchschnitt", // (g)
data: filteredData
.filter((p) => typeof p.g === "number")
.map((p) => ({ x: new Date(p.t), y: p.g })),
@@ -254,6 +244,17 @@ export default function AnalogInputsChart() {
pointRadius: 0,
tension: 0.1,
},
{
label: "Maximum", // (a)
data: filteredData
.filter((p) => typeof p.a === "number")
.map((p) => ({ x: new Date(p.t), y: p.a })),
borderColor: "gray",
borderDash: [4, 2],
borderWidth: 1,
pointRadius: 0,
tension: 0.1,
},
]
: [],
};