document.addEventListener("DOMContentLoaded", () => {
    const canvases = document.querySelectorAll("canvas[id^='uptimeChart-']");

    canvases.forEach(canvas => {
        const ctx = canvas.getContext('2d');

        // Hier kannst du Daten dynamisch anpassen, ggf. mit data-* Attributen
        new Chart(ctx, {
            type: 'line',
            data: {
                labels: ['0h', '6h', '12h', '18h', '24h'],
                datasets: [{
                    label: 'Uptime (%)',
                    data: [100, 90, 80, 100, 95], // Beispielwerte
                    borderColor: '#3b82f6',
                    backgroundColor: 'rgba(59, 130, 246, 0.1)',
                    tension: 0.3,
                    fill: true,
                }]
            },
            options: {
                responsive: true,
                plugins: {
                    legend: { display: false }
                },
                scales: {
                    y: {
                        beginAtZero: true,
                        max: 100
                    }
                }
            }
        });
    });
});
