Statistics Module
The Statistics module provides detailed business insights through four interactive Chart.js visualizations, KPI cards, and a product performance table.Overview
Access comprehensive statistics at/estadisticas with:
KPI Dashboard
Four metric cards tracking key business indicators
Sales Trends
Monthly sales progression with line chart
User Demographics
Gender distribution with doughnut chart
Product Performance
Top selling products with horizontal bar chart
Route Configuration
The statistics page is defined inroutes/web.php:
View file:
resources/views/estadisticas.blade.phpPage Layout
The statistics page extends the main app layout:Page Header
The header includes an export button for data extraction:KPI Metrics Cards
Four comprehensive metrics provide business overview:Chart Visualizations
The statistics module includes four distinct Chart.js visualizations:1. Monthly Sales Chart (Line Chart)
Tracks sales progression over six months:Chart Configuration
Sales Data Breakdown
Sales Data Breakdown
| Month | Sales Amount | Growth |
|---|---|---|
| Enero | $5,000 | Baseline |
| Febrero | $7,500 | +50% |
| Marzo | $6,800 | -9% |
| Abril | $9,200 | +35% |
| Mayo | $11,500 | +25% |
| Junio | $14,200 | +23% |
2. Gender Demographics Chart (Doughnut Chart)
Visualizes user distribution by gender:Chart Configuration
Hombres
55% - Blue
Mujeres
40% - Pink
Otros
5% - Yellow
3. Top Products Chart (Horizontal Bar Chart)
Displays best-selling products by units sold:Chart Configuration
The
indexAxis: 'y' option creates horizontal bars instead of vertical bars.Product Performance Data
| Product | Units Sold | Color |
|---|---|---|
| Smartphone | 342 | Blue |
| Laptop | 156 | Teal |
| Auriculares | 89 | Yellow |
| Tablet | 67 | Teal |
| Cámara | 45 | Pink |
4. Revenue Distribution Chart (Pie Chart)
Breakdown of revenue by category:Chart Configuration
Electrónica
45% of total revenue
Accesorios
25% of total revenue
Servicios
20% of total revenue
Otros
10% of total revenue
Product Statistics Table
Detailed product performance metrics in a sortable table:Product Performance Summary
- Top Performers
- Mid Performers
- Needs Attention
Laptop Pro
- Units: 156
- Revenue: $23,400
- Margin: 35%
- Status: Alto
- Units: 342 (highest)
- Revenue: $15,890
- Margin: 28%
- Status: Alto
Complete Chart Scripts
All charts are initialized in the@section('scripts') block:
Chart Types Overview
Line Chart
Best for: Time series data, trends over timeUsed for: Monthly sales progression
Doughnut Chart
Best for: Part-to-whole relationships with center holeUsed for: Gender demographics
Bar Chart
Best for: Comparing quantities across categoriesUsed for: Product sales comparison (horizontal)
Pie Chart
Best for: Showing proportions of a wholeUsed for: Revenue distribution by category
Customization Guide
Next Steps
Analytics Module
Explore traffic analysis and conversion tracking
Dashboard Overview
Return to main dashboard documentation
