Skip to content

feat(dashboard): add revenue target and cost per route widgets#436

Merged
Damidesign merged 1 commit into
Navin-xmr:mainfrom
Caneryy:feat/dashboard-widgets-415-416
Jun 26, 2026
Merged

feat(dashboard): add revenue target and cost per route widgets#436
Damidesign merged 1 commit into
Navin-xmr:mainfrom
Caneryy:feat/dashboard-widgets-415-416

Conversation

@Caneryy

@Caneryy Caneryy commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Resolves two open dashboard issues:

Closes #415
Closes #416

Changes

#415 — Cost per Route Analytics Widget

  • Created CostPerRouteWidget.tsx with horizontal stacked bar chart for top 10 routes by cost
  • Segmented bars by cost components: base, fuel, customs, insurance
  • Added chart/table view toggle with margin color-coding (green > 20%, yellow 10–20%, red < 10%)
  • Clicking a route opens a drill-down modal listing shipments on that route
  • Tooltip shows per-segment cost breakdown

#416 — Monthly Revenue vs Target Gauge Widget

  • Created RevenueTargetWidget.tsx with Recharts RadialBarChart gauge
  • Center text shows current revenue and % of target achieved
  • Gauge fill color by threshold: green ≥ 100%, blue 75–99%, orange 50–74%, red < 50%
  • Displays actual vs target values and projected end-of-month revenue from daily run rate
  • Added daily revenue sparkline for the current month

Integration

  • Added both widgets to CompanyDashboard.tsx below RevenueSummaryWidget
  • Exported widgets from components/index.ts

Test plan

  • Unit tests for gauge thresholds, margin calculations, widget rendering, table toggle, and route drill-down modal
  • Open company dashboard and verify both widgets render side by side
  • Confirm gauge color and center text update with achievement ratio
  • Toggle Cost per Route chart/table views and open route modal from both views

Add monthly revenue gauge and route cost analytics widgets to the company dashboard.
@Damidesign
Damidesign merged commit a64f40d into Navin-xmr:main Jun 26, 2026
2 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant