edmundson/pixelpulse-dashboard
0
1document.addEventListener('DOMContentLoaded', function() {2 // Initialize charts3 initializeCharts();4 5 // Any other JavaScript functionality can go here6});7 8function initializeCharts() {9 // Performance Chart10 const performanceCtx = document.getElementById('performanceChart').getContext('2d');11 const performanceChart = new Chart(performanceCtx, {12 type: 'line',13 data: {14 labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul'],15 datasets: [16 {17 label: 'Revenue',18 data: [12000, 19000, 15000, 22000, 25000, 28000, 32000],19 borderColor: '#3B82F6',20 backgroundColor: 'rgba(59, 130, 246, 0.1)',21 tension: 0.3,22 fill: true23 },24 {25 label: 'Users',26 data: [8000, 12000, 10000, 15000, 18000, 21000, 25000],27 borderColor: '#10B981',28 backgroundColor: 'rgba(16, 185, 129, 0.1)',29 tension: 0.3,30 fill: true31 }32 ]33 },34 options: {35 responsive: true,36 maintainAspectRatio: false,37 plugins: {38 legend: {39 position: 'top',40 },41 tooltip: {42 mode: 'index',43 intersect: false,44 }45 },46 scales: {47 y: {48 beginAtZero: true,49 grid: {50 drawBorder: false51 }52 },53 x: {54 grid: {55 display: false56 }57 }58 }59 }60 });61}