diff --git a/freezing/web/templates/explore/indiv_elev_dist.html b/freezing/web/templates/explore/indiv_elev_dist.html index 407c683..d57f8b0 100644 --- a/freezing/web/templates/explore/indiv_elev_dist.html +++ b/freezing/web/templates/explore/indiv_elev_dist.html @@ -46,12 +46,12 @@ } }, point: { - r: ({index}) => jsonData.speeds[index], + r: ({index}) => jsonData.speeds[index] * jsonData.speeds[index] / 12, }, tooltip: { contents: function ([{index}]) { return "" + - "" + + "" + "" + "" + "" + diff --git a/freezing/web/templates/leaderboard/team_various.html b/freezing/web/templates/leaderboard/team_various.html index b83336e..245c7e2 100644 --- a/freezing/web/templates/leaderboard/team_various.html +++ b/freezing/web/templates/leaderboard/team_various.html @@ -63,7 +63,7 @@ format: { title: (i) => '#' + jsonData.ranks[i] + ': ' + jsonData.labels[i], value: (value, ratio, id, index) => - jsonData.tooltips ? jsonData.tooltips[index] : +value.toFixed(jsonData.precision ?? 0) + jsonData.suffix + jsonData.tooltips ? jsonData.tooltips[index] : (+value.toFixed(jsonData.precision ?? 0)).toLocaleString() + jsonData.suffix }, }, legend: { diff --git a/freezing/web/views/chartdata.py b/freezing/web/views/chartdata.py index bc984c1..2d83f4c 100644 --- a/freezing/web/views/chartdata.py +++ b/freezing/web/views/chartdata.py @@ -863,19 +863,22 @@ def indiv_elev_dist(): indiv_q = meta.scoped_session().execute(q).fetchall() # @UndefinedVariable - labels = [] + athletes = [] + teams = [] elevations = [] distances = [] speeds = [] for i, res in enumerate(indiv_q): - labels.append(res["athlete_name"]) + athletes.append(res["athlete_name"]) + teams.append(res["team_name"]) elevations.append(int(res["total_elevation_gain"])) distances.append(res["total_distance"]) speeds.append(res["avg_speed"]) return jsonify( { - "labels": labels, + "athletes": athletes, + "teams": teams, "elevations": elevations, "distances": distances, "speeds": speeds,
" + jsonData.labels[index] + "
" + jsonData.athletes[index] + "
" + jsonData.teams[index] + "
distance" + Math.round(jsonData.distances[index]).toLocaleString() + " mi
elevation" + Math.round(jsonData.elevations[index]).toLocaleString() + " feet
speed" + +jsonData.speeds[index]?.toFixed(1) + "mph