Files
SneakySwole/app/templates/partials/progress_chart.html
Phillip Tarrant 134542b66f feat: add Phase 5 Progression & Analytics — smart suggestions, dashboard, schedule
Add auto-progression engine (ProgressionService) with rep increase, weight
increase, deload, and felt-easy acceleration rules. Add AnalyticsService for
user stats, exercise progress charts, and volume-by-day data. New dashboard
and schedule routes with Chart.js visualizations. Progression badges shown
inline on workout day view. Navigation updated with Dashboard and Schedule links.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 12:26:23 -06:00

57 lines
1.9 KiB
HTML

<canvas id="progress-chart" style="max-height:300px;"></canvas>
<p id="progress-chart-empty" style="display:none;">No data yet.</p>
<script>
(function() {
var data = {{ progress_data_json|safe }};
if (!data.dates || data.dates.length === 0) {
document.getElementById('progress-chart').style.display = 'none';
document.getElementById('progress-chart-empty').style.display = 'block';
return;
}
new Chart(document.getElementById('progress-chart'), {
type: 'line',
data: {
labels: data.dates,
datasets: [
{
label: 'Avg Reps',
data: data.reps,
borderColor: 'rgba(99, 102, 241, 1)',
backgroundColor: 'rgba(99, 102, 241, 0.2)',
yAxisID: 'y-reps',
tension: 0.3
},
{
label: 'Weight (lbs)',
data: data.weights,
borderColor: 'rgba(244, 63, 94, 1)',
backgroundColor: 'rgba(244, 63, 94, 0.2)',
yAxisID: 'y-weight',
tension: 0.3
}
]
},
options: {
responsive: true,
interaction: { mode: 'index', intersect: false },
scales: {
'y-reps': {
type: 'linear', display: true, position: 'left',
title: { display: true, text: 'Reps', color: '#ccc' },
ticks: { color: '#ccc' }
},
'y-weight': {
type: 'linear', display: true, position: 'right',
title: { display: true, text: 'Weight (lbs)', color: '#ccc' },
ticks: { color: '#ccc' },
grid: { drawOnChartArea: false }
},
x: { ticks: { color: '#ccc' } }
}
}
});
})();
</script>