feat(analogInputsChart): zeige Minimum (i) und Maximum (a) als zusätzliche Linien im Chart
- Chart zeigt jetzt Messwert (m), Minimum (i, grün) und Maximum (a, rot) für ausgewählten Zeitraum - Tooltip und Legende angepasst - Typdefinitionen für Chart
This commit is contained in:
@@ -6,6 +6,6 @@ NEXT_PUBLIC_USE_MOCK_BACKEND_LOOP_START=false
|
|||||||
NEXT_PUBLIC_EXPORT_STATIC=false
|
NEXT_PUBLIC_EXPORT_STATIC=false
|
||||||
NEXT_PUBLIC_USE_CGI=false
|
NEXT_PUBLIC_USE_CGI=false
|
||||||
# App-Versionsnummer
|
# App-Versionsnummer
|
||||||
NEXT_PUBLIC_APP_VERSION=1.6.607
|
NEXT_PUBLIC_APP_VERSION=1.6.608
|
||||||
NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter)
|
NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter)
|
||||||
|
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ NEXT_PUBLIC_CPL_API_PATH=/CPL
|
|||||||
NEXT_PUBLIC_EXPORT_STATIC=true
|
NEXT_PUBLIC_EXPORT_STATIC=true
|
||||||
NEXT_PUBLIC_USE_CGI=true
|
NEXT_PUBLIC_USE_CGI=true
|
||||||
# App-Versionsnummer
|
# App-Versionsnummer
|
||||||
NEXT_PUBLIC_APP_VERSION=1.6.607
|
NEXT_PUBLIC_APP_VERSION=1.6.608
|
||||||
NEXT_PUBLIC_CPL_MODE=production
|
NEXT_PUBLIC_CPL_MODE=production
|
||||||
@@ -1,3 +1,12 @@
|
|||||||
|
## [1.6.608] – 2025-07-21
|
||||||
|
|
||||||
|
- feat(analogInputsChart): zeige Minimum (i) und Maximum (a) als zusätzliche Linien im Chart
|
||||||
|
|
||||||
|
- Chart zeigt jetzt Messwert (m), Minimum (i, grün) und Maximum (a, rot) für ausgewählten Zeitraum
|
||||||
|
- Tooltip und Legende angepasst
|
||||||
|
- Typdefinitionen für Chart
|
||||||
|
|
||||||
|
---
|
||||||
## [1.6.607] – 2025-07-21
|
## [1.6.607] – 2025-07-21
|
||||||
|
|
||||||
- Nach Betriebsferien einmal sichern
|
- Nach Betriebsferien einmal sichern
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ export default function AnalogInputsChart() {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const dispatch = useDispatch<AppDispatch>();
|
const dispatch = useDispatch<AppDispatch>();
|
||||||
const chartRef = useRef<ChartJS | null>(null);
|
const chartRef = useRef<any>(null);
|
||||||
|
|
||||||
const { zeitraum, vonDatum, bisDatum, data, autoLoad, selectedId } =
|
const { zeitraum, vonDatum, bisDatum, data, autoLoad, selectedId } =
|
||||||
useSelector((state: RootState) => state.analogInputsHistory);
|
useSelector((state: RootState) => state.analogInputsHistory);
|
||||||
@@ -83,10 +83,13 @@ export default function AnalogInputsChart() {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
if (chartRef.current) {
|
if (
|
||||||
|
chartRef.current &&
|
||||||
|
chartRef.current.options &&
|
||||||
|
chartRef.current.options.scales &&
|
||||||
|
chartRef.current.options.scales.x
|
||||||
|
) {
|
||||||
const chart = chartRef.current;
|
const chart = chartRef.current;
|
||||||
|
|
||||||
// Aktualisiere die X-Achse basierend auf den neuesten Werten
|
|
||||||
chart.options.scales.x.min = new Date(latestVonDatum).getTime();
|
chart.options.scales.x.min = new Date(latestVonDatum).getTime();
|
||||||
chart.options.scales.x.max = new Date(latestBisDatum).getTime();
|
chart.options.scales.x.max = new Date(latestBisDatum).getTime();
|
||||||
|
|
||||||
@@ -107,7 +110,10 @@ export default function AnalogInputsChart() {
|
|||||||
label: selectedAnalogInput?.label
|
label: selectedAnalogInput?.label
|
||||||
? `Messwerteingang ${selectedAnalogInput.label}`
|
? `Messwerteingang ${selectedAnalogInput.label}`
|
||||||
: "Messwerte",
|
: "Messwerte",
|
||||||
data: filteredData.map((point) => ({ x: point.t, y: point.m })),
|
data: filteredData.map((point) => ({
|
||||||
|
x: new Date(point.t),
|
||||||
|
y: point.m,
|
||||||
|
})),
|
||||||
fill: false,
|
fill: false,
|
||||||
borderColor: getColor("littwin-blue"),
|
borderColor: getColor("littwin-blue"),
|
||||||
backgroundColor: "rgba(59,130,246,0.3)",
|
backgroundColor: "rgba(59,130,246,0.3)",
|
||||||
@@ -117,7 +123,6 @@ export default function AnalogInputsChart() {
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
// Erzwinge ein vollständiges Redraw des Diagramms
|
|
||||||
chart.update("none");
|
chart.update("none");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -177,7 +182,10 @@ export default function AnalogInputsChart() {
|
|||||||
label: selectedAnalogInput?.label
|
label: selectedAnalogInput?.label
|
||||||
? `Messwert (m) ${selectedAnalogInput.label}`
|
? `Messwert (m) ${selectedAnalogInput.label}`
|
||||||
: "Messwert (m)",
|
: "Messwert (m)",
|
||||||
data: filteredData.map((point) => ({ x: point.t, y: point.m })),
|
data: filteredData.map((point) => ({
|
||||||
|
x: new Date(point.t),
|
||||||
|
y: point.m,
|
||||||
|
})),
|
||||||
fill: false,
|
fill: false,
|
||||||
borderColor: getColor("littwin-blue"),
|
borderColor: getColor("littwin-blue"),
|
||||||
backgroundColor: "rgba(59,130,246,0.3)",
|
backgroundColor: "rgba(59,130,246,0.3)",
|
||||||
@@ -189,7 +197,7 @@ export default function AnalogInputsChart() {
|
|||||||
label: "Minimum (i)",
|
label: "Minimum (i)",
|
||||||
data: filteredData
|
data: filteredData
|
||||||
.filter((point) => typeof point.i === "number")
|
.filter((point) => typeof point.i === "number")
|
||||||
.map((point) => ({ x: point.t, y: point.i })),
|
.map((point) => ({ x: new Date(point.t), y: point.i })),
|
||||||
fill: false,
|
fill: false,
|
||||||
borderColor: "#22c55e", // grün
|
borderColor: "#22c55e", // grün
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
@@ -201,7 +209,7 @@ export default function AnalogInputsChart() {
|
|||||||
label: "Maximum (a)",
|
label: "Maximum (a)",
|
||||||
data: filteredData
|
data: filteredData
|
||||||
.filter((point) => typeof point.a === "number")
|
.filter((point) => typeof point.a === "number")
|
||||||
.map((point) => ({ x: point.t, y: point.a })),
|
.map((point) => ({ x: new Date(point.t), y: point.a })),
|
||||||
fill: false,
|
fill: false,
|
||||||
borderColor: "#ef4444", // rot
|
borderColor: "#ef4444", // rot
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.607",
|
"version": "1.6.608",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.607",
|
"version": "1.6.608",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fontsource/roboto": "^5.1.0",
|
"@fontsource/roboto": "^5.1.0",
|
||||||
"@headlessui/react": "^2.2.4",
|
"@headlessui/react": "^2.2.4",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cpl-v4",
|
"name": "cpl-v4",
|
||||||
"version": "1.6.607",
|
"version": "1.6.608",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
|
|||||||
Reference in New Issue
Block a user