File size: 2,087 Bytes
59974c0
 
 
 
 
 
 
 
caa3c72
 
602538e
59974c0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
document.addEventListener('DOMContentLoaded', function() {
    // Sample data - replace with actual API calls if needed
    const months = ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'];
    const tokenData = {
        labels: months,
        datasets: [{
            label: 'Tokens Gerados',
            data: [1245, 1890, 1823, 2345, 2789, 3021, 3420, 3210, 2956, 2567, 2108, 1765],
            backgroundColor: 'rgba(255, 88, 15, 0.8)',
            borderColor: 'rgba(255, 61, 0, 1)',
borderWidth: 1,
            borderRadius: {
                topLeft: 6,
                topRight: 6
            },
            borderSkipped: false
        }]
    };

    // Chart configuration
    const config = {
        type: 'bar',
        data: tokenData,
        options: {
            responsive: true,
            maintainAspectRatio: false,
            plugins: {
                legend: {
                    display: false
                },
                tooltip: {
                    callbacks: {
                        label: function(context) {
                            return context.parsed.y.toLocaleString() + ' tokens';
                        }
                    }
                }
            },
            scales: {
                y: {
                    beginAtZero: true,
                    grid: {
                        drawBorder: false,
                        color: 'rgba(0, 0, 0, 0.05)'
                    },
                    ticks: {
                        callback: function(value) {
                            return value.toLocaleString();
                        }
                    }
                },
                x: {
                    grid: {
                        display: false
                    }
                }
            },
            animation: {
                duration: 1000,
                easing: 'easeOutQuart'
            }
        }
    };

    // Initialize chart
    const ctx = document.getElementById('tokenChart').getContext('2d');
    new Chart(ctx, config);
});