fix(system-charts): Zeitachse angepasst – aktuelle Daten jetzt rechts wie bei Kabelüberwachung

This commit is contained in:
ISA
2025-07-10 13:22:11 +02:00
parent b7b0829c5b
commit a8c027bd6e
7 changed files with 18 additions and 8 deletions

View File

@@ -42,8 +42,9 @@ export const DetailModal = ({
}
});
const labels = reduxData.map((e: ReduxDataEntry) => e.t);
const values = reduxData.map((e: ReduxDataEntry) => e.i);
const reversedData = [...reduxData].reverse();
const labels = reversedData.map((e) => e.t);
const values = reversedData.map((e) => e.i);
const baseOptions = {
responsive: true,

View File

@@ -38,7 +38,11 @@ type Props = {
zeitraum: "DIA0" | "DIA1" | "DIA2";
};
export const SystemCharts = ({ history }: Props) => {
const labels = history.map((h) => new Date(h.time).toLocaleTimeString());
const reversedHistory = [...history].reverse();
const labels = reversedHistory.map((h) =>
new Date(h.time).toLocaleTimeString()
);
const formatValue = (v: number) => v.toFixed(2);
const baseOptions = {