feat(chart): X-Achsen-Labels optimiert für bessere Lesbarkeit

- Jahreszahl aus der X-Achse entfernt, um die Darstellung kompakter zu machen.
- Datumsformat von `TT.MM.YYYY` auf `TT.MM` geändert.
- Achsenbeschriftung um 25° gedreht (`angle: -25`) für bessere Übersicht.
- `dy: 5` hinzugefügt, um die Abstände der Labels anzupassen.
This commit is contained in:
Ismail Ali
2025-03-15 11:42:17 +01:00
parent e0379c24a6
commit da28d64f8c
10 changed files with 22 additions and 12 deletions

View File

@@ -179,8 +179,13 @@ const LoopMeasurementChart = () => {
<XAxis
dataKey="zeit"
domain={["dataMin", "dataMax"]}
tickFormatter={(zeit) => new Date(zeit).toLocaleDateString()}
tickFormatter={(zeit) => {
const date = new Date(zeit);
return `${date.getDate()}.${date.getMonth() + 1}`;
}}
tick={{ angle: -25, dy: 5 }} // Dreht die Labels für bessere Übersicht
/>
<YAxis
label={{ value: unit, angle: -90, position: "insideLeft" }}
domain={["auto", "auto"]}