CoolFace
Apppublic

Zchief/financial-transparency-tracker

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
script.js60 linesDownload Raw Back to root
1// Global utility functions can be added here2document.addEventListener('DOMContentLoaded', () => {3    // Revenue Chart4    const revenueCtx = document.getElementById('revenueChart').getContext('2d');5    new Chart(revenueCtx, {6        type: 'doughnut',7        data: {8            labels: ['Indigenous Services Canada', 'Other Income', 'First Nations Health Authority', 'Forestry', 'Other Sources'],9            datasets: [{10                data: [26665203, 10707723, 2232745, 2675845, 4693479],11                backgroundColor: [12                    '#3B82F6',13                    '#10B981',14                    '#8B5CF6',15                    '#F59E0B',16                    '#6366F1'17                ],18                borderWidth: 019            }]20        },21        options: {22            responsive: true,23            plugins: {24                legend: {25                    position: 'right'26                }27            },28            cutout: '70%'29        }30    });31 32    // Expense Chart33    const expenseCtx = document.getElementById('expenseChart').getContext('2d');34    new Chart(expenseCtx, {35        type: 'bar',36        data: {37            labels: ['Salaries', 'Social Assistance', 'Contracted Services', 'Repairs & Maintenance', 'Other'],38            datasets: [{39                label: '2025',40                data: [5481217, 770407, 1228488, 1636632, 8637553],41                backgroundColor: '#3B82F6',42                borderRadius: 443            }, {44                label: '2024',45                data: [4654401, 950959, 773142, 873104, 5920201],46                backgroundColor: '#E5E7EB',47                borderRadius: 448            }]49        },50        options: {51            responsive: true,52            scales: {53                y: {54                    beginAtZero: true55                }56            }57        }58    });59});60