Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Commit

Permalink
All time BMI chart
Browse files Browse the repository at this point in the history
  • Loading branch information
spech66 committed Dec 25, 2020
1 parent 44ab494 commit dce61d6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions templates/weightgraph.htm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ <h1>Weight</h1>
<canvas id="weightChartYear"></canvas>
<canvas id="weightChartYearBmi"></canvas>
<canvas id="weightChartAll"></canvas>
<canvas id="weightChartAllBmi"></canvas>

<p>
<a class="btn btn-secondary btn-lg" href="/weight" role="button"><i class="fas fa-arrow-circle-left fa-2x"></i><br />Back</a>
Expand Down Expand Up @@ -184,11 +185,19 @@ <h1>Weight</h1>
y: sel.weight
}});
const resultAllTrend = generateTrend(resultAll);
const resultAllBmi = mappedMeasurements.map(sel => { return {
x: sel.date,
y: sel.bmi
}});
const resultAllBmiThresholds = generateBmiThresholds(resultAllBmi);

generateChart("weightChartShort", "2 Month", '#7EB26D', '#7EB26D88', result2Month, result2MonthTrend,);

generateChart("weightChartYear", "1 Year Weight", '#7EB26D', '#7EB26D88', result1Year, result1YearTrend);
generateChart("weightChartYearBmi", "1 Year BMI", '#335d99','#335d9988', result1YearBmi, null, result1YearBmiThresholds);

generateChart("weightChartAll", "All", '#7EB26D', '#7EB26D88', resultAll, resultAllTrend);
generateChart("weightChartAllBmi", "All BMI", '#335d99','#335d9988', resultAllBmi, null, resultAllBmiThresholds);
});
});
</script>
Expand Down

0 comments on commit dce61d6

Please sign in to comment.