Repository navigation
Add per-service savings-range bar chart on Home page (solid floor + lighter range, surface ByService data already on the wire) #765
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or requestimpact/all-usersAffects every userAffects every userpriority/p2Backlog-worthyBacklog-worthyseverity/lowMinor harmMinor harmtriagedItem has been triagedItem has been triagedurgency/this-sprintWithin the current sprintWithin the current sprint
Description
Summary
Add a per-service savings-range bar chart to the Home page, supplementing the existing cumulative savings-over-time line chart. The backend already exposes the necessary data via HistoryDataPoint.ByService map[string]float64 on /api/dashboard/savings-over-time; the frontend currently drops that field on the floor.
Design
- Layout: one vertical bar per service (EC2/RDS/ElastiCache/OpenSearch/Compute/Database/Cache/... — whatever services appear in the response over the selected timeframe).
- Bar composition: the bar runs from 0 to max(savings) for that service across the selected timeframe, split into two shades:
- Solid base from 0 to min(savings) for that service — the "guaranteed floor": this service has consistently delivered at least this much across the window.
- Lighter shade from min to max(savings) — the "range upside": how much the savings can swing over the window.
- Y-axis: dollars (same units as the existing chart).
- X-axis: service names (sorted by max desc so the largest service is leftmost).
- Hover tooltip: per service, show min / median / max / count-of-points, and the percentage of total realized savings the service contributed.
- Empty state: when no service has positive savings in the window, mirror the line chart's friendly empty-state message.
- Filter coupling: the new bar chart honours the same account / provider / timeframe filter chips as the line chart and KPI cards (see Home chart drifts from KPIs when a provider filter is active (analytics endpoint missing provider param) #764 for the provider filter gap that affects all three).
Data path
HistoryDataPoint.ByService is already returned per data point by the analytics handler. Frontend just needs to:
- Iterate the
data_pointsarray, accumulate per-servicemin/max/sum/countover the window. - Render two-stacked bars:
[0 -> min]solid,[min -> max]light.
No backend change required unless by_service is missing on some data points (in which case the analytics aggregator needs to populate it consistently — verify).
Placement
Below the existing cumulative line chart in the Home page Savings section. Same width, same range-selector controls (1d/7d/30d/90d/all) reused.
Test plan
- Unit test: synthetic
data_pointswith known per-service values produces correct min/max bars. - Empty state when zero positive-savings services.
- Multi-account filter shrinks bars to the filtered subset.
- Hover tooltip values match the bar geometry.
- Regression: existing cumulative chart still renders correctly above the new bars.
Out of scope (separate issues)
- Provider filter on the analytics endpoint — tracked by Home chart drifts from KPIs when a provider filter is active (analytics endpoint missing provider param) #764.
- Replacing the cumulative line chart entirely — decide after this lands, based on UX feedback.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestimpact/all-usersAffects every userAffects every userpriority/p2Backlog-worthyBacklog-worthyseverity/lowMinor harmMinor harmtriagedItem has been triagedItem has been triagedurgency/this-sprintWithin the current sprintWithin the current sprint
Activity
feat(home/chart): add per-service savings-range bar chart (closes #765)
feat(home/chart): add per-service savings-range bar chart (closes #765)…
cristim commentedon May 28, 2026
Verified shipped: PRs #766 (commit 51bdab8, merged 2026-05-27) and #782 (commit c72601e, merged 2026-05-28) are both in feat/multicloud-web-frontend. dashboard.ts renders per-service min/max range bars using ByService data; PR #782 repoints bars to potential savings and moves them to the Potential section. Tests in dashboard.test.ts.