diff --git a/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopMeasurementChart.tsx b/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopMeasurementChart.tsx index 8c53f44..c24a8f0 100644 --- a/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopMeasurementChart.tsx +++ b/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopMeasurementChart.tsx @@ -161,7 +161,44 @@ const LoopMeasurementChart = () => { tickFormatter={(wert) => `${wert.toFixed(2)} kOhm`} /> } /> - + { + if (!payload) return null; + + // Reihenfolge der Legende anpassen + const orderedPayload = [...payload].sort((a, b) => { + const order = [ + "messwertMinimum", + "messwert", + "messwertDurchschnitt", + "messwertMaximum", + ]; + return order.indexOf(a.value) - order.indexOf(b.value); + }); + + return ( +
+ {orderedPayload.map((entry, index) => ( + + ⬤ {entry.value} + + ))} +
+ ); + }} + /> +