feat: implement Date in anlog inputs chart

This commit is contained in:
ISA
2025-06-27 13:58:34 +02:00
parent 0b70ef68e9
commit 4b19884c1e
6 changed files with 36 additions and 10 deletions

View File

@@ -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.497
NEXT_PUBLIC_APP_VERSION=1.6.499
NEXT_PUBLIC_CPL_MODE=json # json (Entwicklungsumgebung) oder jsSimulatedProd (CPL ->CGI-Interface-Simulator) oder production (CPL-> CGI-Interface Platzhalter)

View File

@@ -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.497
NEXT_PUBLIC_APP_VERSION=1.6.499
NEXT_PUBLIC_CPL_MODE=production

View File

@@ -1,3 +1,13 @@
## [1.6.499] 2025-06-27
- cleanup: delete old analog inputs mock data
---
## [1.6.498] 2025-06-27
- cleanup: delete old analog inputs mock data
---
## [1.6.497] 2025-06-27
- fix: show history digital input

View File

@@ -113,7 +113,23 @@ export default function AnalogInputsChart({
responsive: true,
plugins: {
legend: { position: "top" as const },
tooltip: { mode: "index" as const, intersect: false },
tooltip: {
mode: "index" as const,
intersect: false,
callbacks: {
label: function (context: import("chart.js").TooltipItem<"line">) {
const y = context.parsed.y;
return `Messwert: ${y}`;
},
title: function (
tooltipItems: import("chart.js").TooltipItem<"line">[]
) {
const date = tooltipItems[0].parsed.x;
return `Zeitpunkt: ${new Date(date).toLocaleString("de-DE")}`;
},
},
},
title: {
display: true,
text: `Verlauf der letzten 24 Stunden`,
@@ -134,13 +150,13 @@ export default function AnalogInputsChart({
x: {
type: "time" as const,
time: {
unit: "hour" as const,
tooltipFormat: "HH:mm 'Uhr' dd.MM.",
unit: "day", // nur Datum in Achse
tooltipFormat: "dd.MM.yyyy HH:mm", // aber Uhrzeit im Tooltip sichtbar
displayFormats: {
hour: "HH:mm",
day: "dd.MM.",
day: "dd.MM.yyyy",
},
},
adapters: {
date: {
locale: de,

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "cpl-v4",
"version": "1.6.497",
"version": "1.6.499",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "cpl-v4",
"version": "1.6.497",
"version": "1.6.499",
"dependencies": {
"@fontsource/roboto": "^5.1.0",
"@iconify-icons/ri": "^1.2.10",

View File

@@ -1,6 +1,6 @@
{
"name": "cpl-v4",
"version": "1.6.497",
"version": "1.6.499",
"private": true,
"scripts": {
"dev": "next dev",