fix five min js
This commit is contained in:
@@ -4,6 +4,9 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||||||
const startTimeInput = document.getElementById('startTime');
|
const startTimeInput = document.getElementById('startTime');
|
||||||
const endTimeInput = document.getElementById('endTime');
|
const endTimeInput = document.getElementById('endTime');
|
||||||
|
|
||||||
|
// Initialisiere die globale Variable für den Chart
|
||||||
|
window.fuenfMinutenChart = null;
|
||||||
|
|
||||||
function fetchAndUpdateChart() {
|
function fetchAndUpdateChart() {
|
||||||
const startDate = startDateInput.value;
|
const startDate = startDateInput.value;
|
||||||
const endDate = endDateInput.value;
|
const endDate = endDateInput.value;
|
||||||
@@ -32,10 +35,12 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||||||
|
|
||||||
const ctx = document.getElementById('fuenfMinutenChart').getContext('2d');
|
const ctx = document.getElementById('fuenfMinutenChart').getContext('2d');
|
||||||
|
|
||||||
|
// Zerstöre den vorhandenen Chart, falls er existiert
|
||||||
if (window.fuenfMinutenChart) {
|
if (window.fuenfMinutenChart) {
|
||||||
window.fuenfMinutenChart.destroy();
|
window.fuenfMinutenChart.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Erstelle einen neuen Chart
|
||||||
window.fuenfMinutenChart = new Chart(ctx, {
|
window.fuenfMinutenChart = new Chart(ctx, {
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
data: {
|
data: {
|
||||||
|
|||||||
Reference in New Issue
Block a user