Files
backend/templates/admin/dashboard_admin.html
2025-09-22 18:43:29 -06:00

25 lines
705 B
HTML

{% load static %}
<div>
<canvas id="myChart" width="400" height="200"></canvas>
</div>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
const ctx = document.getElementById('myChart').getContext('2d');
const chart = new Chart(ctx, {
type: 'bar', // Puedes cambiar a 'line', 'pie', etc.
data: {
labels: ['Ene', 'Feb', 'Mar', 'Abr', 'May'],
datasets: [{
label: 'Ventas',
data: [10, 20, 30, 40, 50],
backgroundColor: 'rgba(54, 162, 235, 0.6)',
}]
},
options: {
responsive: true,
maintainAspectRatio: false
}
});
</script>