You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add per-service savings-range bar chart on Home page (solid floor + lighter range, surface ByService data already on the wire) #765
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.
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_points with 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.
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]float64on/api/dashboard/savings-over-time; the frontend currently drops that field on the floor.Design
Data path
HistoryDataPoint.ByServiceis already returned per data point by the analytics handler. Frontend just needs to:data_pointsarray, accumulate per-servicemin/max/sum/countover the window.[0 -> min]solid,[min -> max]light.No backend change required unless
by_serviceis 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
data_pointswith known per-service values produces correct min/max bars.Out of scope (separate issues)