Swapped ascent/descent from km/mi to m/ft

This commit is contained in:
Fmstrat
2022-07-18 14:24:41 -04:00
parent 721937e425
commit 8c5e3cf2e4
2 changed files with 8 additions and 5 deletions

View File

@ -137,13 +137,17 @@
const total: number = context.chart.data.datasets
.map((d) => d.data[context.dataIndex])
.reduce((total, value) => getSum(total, value), 0)
let unitFrom = 'km'
if (props.displayedData === 'total_ascent' || props.displayedData === 'total_descent')
unitFrom = 'm'
return context.datasetIndex ===
props.displayedSportIds.length - 1 && total > 0
? formatTooltipValue(
props.displayedData,
total,
props.useImperialUnits,
false
false,
unitFrom
)
: null
}