Files
laatzen/LaaProductionWeb/LaaProductionWeb.Blazor/Components/HeliumTester/Statistics.razor.js
T
2025-03-17 16:03:24 +01:00

134 lines
3.1 KiB
JavaScript

var chartHel;
var chartHep;
var chartWap;
export function clearCharts() {
chartHel.options.animation = false;
chartHel.data.datasets = [];
chartHel.update();
chartHep.options.animation = false;
chartHep.data.datasets = [];
chartHep.update();
chartWap.options.animation = false;
chartWap.data.datasets = [];
chartWap.update();
}
export function showHelChart(data) {
chartHel.options.animation = false;
chartHel.data = JSON.parse(data).data;
chartHel.update();
}
export function showHepChart(data) {
chartHep.options.animation = false;
chartHep.data = JSON.parse(data).data;
chartHep.update();
}
export function showWapChart(data) {
chartWap.options.animation = false;
chartWap.data = JSON.parse(data).data;
chartWap.update();
}
export function setUpCahrts() {
if (chartHel) {
chartHel.destroy();
}
chartHel = new Chart('hel', {
type: 'line',
options: {
plugins: {
title: {
display: true,
text: 'Heliumlekage',
align: 'start'
}
},
scales: {
y: {
title: {
display: true,
text: 'bar',
align: 'end'
}
},
x: {
title: {
display: true,
text: 'seconds',
align: 'end'
}
}
}
}
});
if (chartHep) {
chartHep.destroy();
}
chartHep = new Chart('hed', {
type: 'line',
options: {
plugins: {
title: {
display: true,
text: 'Heliumdruck',
align: 'start'
}
},
scales: {
y: {
title: {
display: true,
text: 'bar',
align: 'end'
}
},
x: {
title: {
display: true,
text: 'seconds',
align: 'end'
}
}
}
}
});
if (chartWap) {
chartWap.destroy();
}
chartWap = new Chart('wap', {
type: 'line',
options: {
plugins: {
title: {
display: true,
text: 'Wasserdruck',
align: 'start'
}
},
scales: {
y: {
title: {
display: true,
text: 'bar',
align: 'end'
}
},
x: {
title: {
display: true,
text: 'seconds',
align: 'end'
}
}
}
}
});
}