feat: Add units (MOhm, kOhm) to chart axes in Schleifenmessung and Isolationswiderstand
feat: Log chart data in console for each slot in createChart function
This commit is contained in:
@@ -288,15 +288,14 @@ function Dashboard() {
|
|||||||
<div className="flex flex-row p-2 space-x-2">
|
<div className="flex flex-row p-2 space-x-2">
|
||||||
<Icon icon="bx:code-block" className="text-xl text-blue-400" />
|
<Icon icon="bx:code-block" className="text-xl text-blue-400" />
|
||||||
<p className="text-sm text-gray-600">
|
<p className="text-sm text-gray-600">
|
||||||
<span className="font-bold">
|
<span className="font-bold"></span> Applikationsversion:{" "}
|
||||||
Applikationsversion: {appVersion}{" "}
|
{appVersion}{" "}
|
||||||
</span>
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-row p-2 space-x-2">
|
<div className="flex flex-row p-2 space-x-2">
|
||||||
<Icon icon="mdi:web" className="text-xl text-blue-400" />
|
<Icon icon="mdi:web" className="text-xl text-blue-400" />
|
||||||
<p className="text-sm text-gray-600">
|
<p className="text-sm text-gray-600">
|
||||||
<span className="font-bold">Webserverversion: </span> 1.0.0
|
<span className="font-bold"> </span>Webserverversion: 1.0.0
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ function Kue705FO({
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Funktion zum Erstellen des Charts
|
||||||
// Funktion zum Erstellen des Charts
|
// Funktion zum Erstellen des Charts
|
||||||
const createChart = (data) => {
|
const createChart = (data) => {
|
||||||
const ctx = document.getElementById("myChart").getContext("2d");
|
const ctx = document.getElementById("myChart").getContext("2d");
|
||||||
@@ -96,21 +97,22 @@ function Kue705FO({
|
|||||||
second: "2-digit",
|
second: "2-digit",
|
||||||
}).format(date);
|
}).format(date);
|
||||||
};
|
};
|
||||||
|
// Ausgabe der Chart-Daten in der Konsole mit Slot-Informationen
|
||||||
|
console.log(`Chart-Daten für Slot ${slotIndex + 1}:`, data);
|
||||||
new Chart(ctx, {
|
new Chart(ctx, {
|
||||||
type: "line",
|
type: "line",
|
||||||
data: {
|
data: {
|
||||||
labels: data.map((row) => formatToGermanDate(row.t)).reverse(), // Zeitwerte ins deutsche Format umwandeln und umkehren
|
labels: data.map((row) => formatToGermanDate(row.t)).reverse(), // Zeitwerte ins deutsche Format umwandeln und umkehren
|
||||||
datasets: [
|
datasets: [
|
||||||
{
|
{
|
||||||
label: "Isolationswiderstand",
|
label: "Isolationswiderstand (MOhm)", // Einheit hinzugefügt
|
||||||
data: data.map((row) => row.m).reverse(),
|
data: data.map((row) => row.m).reverse(),
|
||||||
borderColor: "#00AEEF",
|
borderColor: "#00AEEF",
|
||||||
fill: false,
|
fill: false,
|
||||||
yAxisID: "y",
|
yAxisID: "y",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Schleifenwiderstand",
|
label: "Schleifenwiderstand (kOhm)", // Einheit hinzugefügt
|
||||||
data: data.map((row) => row.n).reverse(),
|
data: data.map((row) => row.n).reverse(),
|
||||||
borderColor: "black",
|
borderColor: "black",
|
||||||
fill: false,
|
fill: false,
|
||||||
@@ -123,15 +125,24 @@ function Kue705FO({
|
|||||||
y: {
|
y: {
|
||||||
type: "linear",
|
type: "linear",
|
||||||
position: "left",
|
position: "left",
|
||||||
|
title: {
|
||||||
|
display: true,
|
||||||
|
text: "MOhm", // Einheit für linke Achse hinzugefügt
|
||||||
|
},
|
||||||
},
|
},
|
||||||
y1: {
|
y1: {
|
||||||
type: "linear",
|
type: "linear",
|
||||||
position: "right",
|
position: "right",
|
||||||
|
title: {
|
||||||
|
display: true,
|
||||||
|
text: "kOhm", // Einheit für rechte Achse hinzugefügt
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// Funktion zum Erstellen des TDR-Charts
|
// Funktion zum Erstellen des TDR-Charts
|
||||||
const createTDRChart = (dataTDR) => {
|
const createTDRChart = (dataTDR) => {
|
||||||
const ctx = document.getElementById("myChart").getContext("2d");
|
const ctx = document.getElementById("myChart").getContext("2d");
|
||||||
|
|||||||
Reference in New Issue
Block a user