Skip to main content

Overview

The analytics module provides real-time insights into your sales performance, inventory status, and business trends through interactive charts and key performance indicators.

Accessing Analytics

1

Navigate to Analytics

Click “Análisis” in the sidebar navigation to open the analytics dashboard.
2

View the dashboard

The analytics page displays multiple sections:
  • Top KPI cards showing today’s metrics
  • Inventory status chart
  • Annual revenue summary
  • Daily income and expenses trends

Today’s Performance Metrics

The top section shows four key performance indicators for today:

Total de Ventas (Revenue)

Shows total sales revenue for the current day with percentage change from yesterday.
  • Red gradient card with bar chart icon
  • Displays total monetary value of sales
  • Shows percentage change (e.g., “+8% respecto a ayer”)
  • Data sourced from analyticsService.getTodayStats()

Órdenes Totales (Total Orders)

  • Yellow gradient card with document icon
  • Shows count of completed transactions
  • Includes comparison to previous day
  • Helps track sales volume regardless of value

Productos Vendidos (Products Sold)

  • Green gradient card with users icon
  • Total quantity of items sold today
  • Useful for inventory turnover analysis
  • Shows growth percentage

Nuevos Clientes (New Customers)

  • Purple gradient card with tag icon
  • Count of unique customers who made purchases today
  • Tracks customer acquisition
  • Displays day-over-day change

Inventory Status Analysis

The inventory chart visualizes stock availability:
1

View the donut chart

The circular chart shows inventory distribution across three categories.
2

Interpret the segments

  • Green segment: Productos disponibles (Available stock)
  • Yellow segment: Stock bajo (Low stock - requires reordering)
  • Red segment: Agotado (Out of stock)
3

Check percentages

Hover over segments to see exact counts and percentages.
Data is calculated by analyticsService.getInventoryAnalysis():
  • Disponible: Products with >10 units or unlimited availability
  • Stock Bajo: Products with 1-10 units remaining
  • Agotado: Products with 0 stock

Annual Revenue Summary

The annual chart displays monthly revenue trends:
1

Review the line chart

The chart shows revenue progression across the last 6 months.
2

Identify trends

Look for:
  • Upward trends (business growth)
  • Seasonal patterns
  • Unusual drops (investigate causes)
  • Peak months (prepare for similar periods)
3

Compare months

Hover over data points to see exact monthly revenue values.

Inventory Rotation

The rotation chart shows which products are selling:
Helps identify fast-moving vs. slow-moving inventory.
  • Displays product sales distribution
  • Highlights top-selling items
  • Identifies stagnant inventory that may need promotion
  • Informs purchasing decisions
The income line chart shows daily revenue:
1

View daily performance

Chart displays the last 7 days of sales revenue.
2

Identify patterns

Look for:
  • Weekday vs. weekend differences
  • Best performing days
  • Days that need attention
3

Plan accordingly

Use insights to:
  • Schedule staff appropriately
  • Plan promotions for slow days
  • Prepare inventory for busy days
Data retrieved via analyticsService.getAnalyticsData() which processes daily sales.

Expenses Tracking (Egresos)

The expenses chart mirrors the income chart:
  • Shows daily operational costs
  • Helps monitor spending patterns
  • Supports profitability analysis
  • Highlights unusual expense spikes

Refreshing Analytics Data

1

Click Actualizar

Click the purple “Actualizar” button in the top-right corner.
2

Wait for refresh

The system:
  • Calls analyticsService.getAnalyticsData() to fetch latest data
  • Updates all charts and KPIs
  • Recalculates percentages and trends
3

Review updated data

All metrics now reflect the most current information.
Analytics automatically refresh when you navigate to the page, but manual refresh ensures the latest data.

Understanding Calculations

Revenue Calculations

// Today's total revenue
const totalRevenue = sales.reduce((sum, sale) => sum + sale.total, 0);

// Average order value
const averageOrderValue = totalRevenue / totalOrders;

Inventory Status

// Products are classified as:
if (product.availability === 'unlimited') {
  // Disponible
} else if (product.stock > 10) {
  // Disponible  
} else if (product.stock > 0) {
  // Stock Bajo
} else {
  // Agotado
}

Growth Percentages

// Calculate percentage change
const growth = ((currentValue - previousValue) / previousValue) * 100;

Key Insights to Monitor

Daily Performance

1

Check morning metrics

Review today’s KPIs each morning to set goals.
2

Monitor throughout the day

Refresh analytics periodically to track progress.
3

Review end-of-day

Compare final results to goals and previous days.

Inventory Health

  • High disponible percentage (>70%): Good stock levels
  • High stock bajo percentage (>30%): Need to reorder soon
  • High agotado percentage (>15%): Urgent attention required
  • Consistent growth: Business expanding well
  • Flat line: Market saturation or need for marketing
  • Declining trend: Investigate causes (competition, seasonality, etc.)

Best Practices

Review analytics daily to make data-driven business decisions.
  • Check daily: Review KPIs every morning
  • Track trends: Look for patterns over weeks and months
  • Compare periods: Analyze week-over-week and month-over-month
  • Act on insights: Use data to drive inventory and sales decisions
  • Monitor inventory: Keep “Agotado” percentage below 10%
  • Watch growth metrics: Positive trends indicate healthy business
  • Investigate anomalies: Sudden changes need immediate attention

Using Analytics for Decision Making

Inventory Decisions

1

Review rotation chart

Identify top-selling products.
2

Check stock status

Ensure best-sellers have adequate stock.
3

Analyze slow movers

Consider promotions for products with low rotation.
4

Plan purchases

Order based on sales velocity and current stock.

Sales Strategy

1

Identify peak days

Review income trends to find busiest days.
2

Schedule staff

Ensure adequate coverage on high-volume days.
3

Plan promotions

Run sales on typically slower days to boost revenue.

Financial Planning

1

Track monthly revenue

Use annual summary to project future income.
2

Monitor expenses

Keep spending in line with revenue.
3

Calculate profitability

Compare income vs. expenses for net profit.

Troubleshooting

Charts Not Displaying

  • Refresh the page (Ctrl+R or Cmd+R)
  • Click the “Actualizar” button
  • Check your internet connection
  • Ensure you’re logged in with valid credentials

Incorrect Data

  • Verify date filters are set correctly
  • Check that sales have been properly recorded
  • Refresh analytics to get latest data
  • Contact administrator if discrepancies persist

Performance Issues

  • Clear browser cache
  • Close unnecessary browser tabs
  • Check system requirements
  • Try a different browser

Technical Reference

Analytics operations use the analyticsService.js service:
  • Get analytics data: analyticsService.getAnalyticsData()
  • Today’s stats: analyticsService.getTodayStats()
  • Inventory analysis: analyticsService.getInventoryAnalysis()
  • Executive summary: analyticsService.getExecutiveSummary()
  • Custom period: analyticsService.getCustomPeriodData(start, end, groupBy)
Charts are rendered using Chart.js library and data is fetched from https://cemac-api.vercel.app/analysis/sales.

Build docs developers (and LLMs) love