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