            return num.toString();
        }

        function initChart(id, type, options = {}) {
            const ctx = document.getElementById(id).getContext('2d');
            charts[id] = new Chart(ctx, {
                type,
                data: {
                    labels: [],
                    datasets: []
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    ...options
                }
         