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_USE_CGI=false
|
||||
# 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)
|
||||
|
||||
|
||||
@@ -5,5 +5,5 @@ NEXT_PUBLIC_CPL_API_PATH=/CPL
|
||||
NEXT_PUBLIC_EXPORT_STATIC=true
|
||||
NEXT_PUBLIC_USE_CGI=true
|
||||
# App-Versionsnummer
|
||||
NEXT_PUBLIC_APP_VERSION=1.6.607
|
||||
NEXT_PUBLIC_APP_VERSION=1.6.608
|
||||
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
|
||||
|
||||
- Nach Betriebsferien einmal sichern
|
||||
|
||||
@@ -59,7 +59,7 @@ export default function AnalogInputsChart() {
|
||||
}, []);
|
||||
|
||||
const dispatch = useDispatch<AppDispatch>();
|
||||
const chartRef = useRef<ChartJS | null>(null);
|
||||
const chartRef = useRef<any>(null);
|
||||
|
||||
const { zeitraum, vonDatum, bisDatum, data, autoLoad, selectedId } =
|
||||
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;
|
||||
|
||||
// Aktualisiere die X-Achse basierend auf den neuesten Werten
|
||||
chart.options.scales.x.min = new Date(latestVonDatum).getTime();
|
||||
chart.options.scales.x.max = new Date(latestBisDatum).getTime();
|
||||
|
||||
@@ -107,7 +110,10 @@ export default function AnalogInputsChart() {
|
||||
label: selectedAnalogInput?.label
|
||||
? `Messwerteingang ${selectedAnalogInput.label}`
|
||||
: "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,
|
||||
borderColor: getColor("littwin-blue"),
|
||||
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");
|
||||
}
|
||||
};
|
||||
@@ -177,7 +182,10 @@ export default function AnalogInputsChart() {
|
||||
label: selectedAnalogInput?.label
|
||||
? `Messwert (m) ${selectedAnalogInput.label}`
|
||||
: "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,
|
||||
borderColor: getColor("littwin-blue"),
|
||||
backgroundColor: "rgba(59,130,246,0.3)",
|
||||
@@ -189,7 +197,7 @@ export default function AnalogInputsChart() {
|
||||
label: "Minimum (i)",
|
||||
data: filteredData
|
||||
.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,
|
||||
borderColor: "#22c55e", // grün
|
||||
borderWidth: 1,
|
||||
@@ -201,7 +209,7 @@ export default function AnalogInputsChart() {
|
||||
label: "Maximum (a)",
|
||||
data: filteredData
|
||||
.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,
|
||||
borderColor: "#ef4444", // rot
|
||||
borderWidth: 1,
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "cpl-v4",
|
||||
"version": "1.6.607",
|
||||
"version": "1.6.608",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "cpl-v4",
|
||||
"version": "1.6.607",
|
||||
"version": "1.6.608",
|
||||
"dependencies": {
|
||||
"@fontsource/roboto": "^5.1.0",
|
||||
"@headlessui/react": "^2.2.4",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cpl-v4",
|
||||
"version": "1.6.607",
|
||||
"version": "1.6.608",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
|
||||
Reference in New Issue
Block a user