Skip to content

Commit

Permalink
Merge pull request #114 from jovandeginste/stats-label
Browse files Browse the repository at this point in the history
Add details to the stats markers
  • Loading branch information
jovandeginste authored Apr 15, 2024
2 parents ba7f60f + 2addb05 commit 3857e81
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions views/partials/workout_show_stats.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@

if (context.dataset.yAxisID === "y") {
label += " {{ CurrentUser.PreferredUnits.Speed }}";
set_marker(null, context.raw.lat, context.raw.lng);
set_marker(
context.raw.label,
context.raw.lat,
context.raw.lng,
);
} else if (context.dataset.yAxisID === "y1") {
label += " {{ CurrentUser.PreferredUnits.Elevation }}";
} else if (context.dataset.yAxisID === "y2") {
Expand All @@ -107,7 +111,7 @@
yAxisID: 'y',
data: [
{{ range .Items -}}
{ "x": {{ .FirstPoint.Time }}, "y": {{ .Speed | HumanSpeed }}, "lat": "{{ .FirstPoint.Lat }}", "lng": "{{ .FirstPoint.Lng }}" },
{ "x": {{ .LastPoint.Time }}, "y": {{ .Speed | HumanSpeed }}, "lat": "{{ .LastPoint.Lat }}", "lng": "{{ .LastPoint.Lng }}", label: "{{ template `workout_point_title` .LastPoint }}" },
{{- end }}
],
},
Expand Down

0 comments on commit 3857e81

Please sign in to comment.