adding macro details to tracker, changing charts to stacked bar chart of macros

This commit is contained in:
2026-01-06 06:49:43 -08:00
parent e91611d441
commit 70b45ede71
5 changed files with 339 additions and 106 deletions

View File

@@ -44,7 +44,10 @@ async def get_charts_data(
day_totals = calculate_day_nutrition_tracked(tracked_meals, db)
chart_data.append({
"date": tracked_day.date.isoformat(),
"calories": round(day_totals.get("calories", 0), 2)
"calories": round(day_totals.get("calories", 0), 2),
"protein": round(day_totals.get("protein", 0), 2),
"fat": round(day_totals.get("fat", 0), 2),
"net_carbs": round(day_totals.get("net_carbs", 0), 2)
})
return chart_data