Skip to content

Commit

Permalink
Merge pull request #93 from Ricecrackerz/Measurement-Graph
Browse files Browse the repository at this point in the history
Measurement Tool - KM Graph
  • Loading branch information
tariqksoliman authored Aug 5, 2021
2 parents f2fd75f + 0d1ee2c commit d779e2e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/essence/Tools/Measure/MeasureTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,10 @@ const Measure = () => {
<Line
ref={refLine}
data={{
labels: MeasureTool.lastData.map((d) =>
parseInt(d[2], 10)
),
labels: MeasureTool.lastData.map((d) => {
const xAxes = parseInt(d[2], 10)
return distDisplayUnit == 'kilometers' ? (xAxes/1000).toFixed(2) : xAxes
}),
datasets: [
{
label: 'Profile',
Expand Down Expand Up @@ -186,7 +187,7 @@ const Measure = () => {
callbacks: {
label: (item) => `${item.yLabel}m`,
title: (item) =>
`${item[0].xLabel}m from start`,
distDisplayUnit == 'meters' ? `${item[0].xLabel}m from start` : `${item[0].xLabel}km from start,`
},
},
onHover: (e, el, el2) => {
Expand Down

0 comments on commit d779e2e

Please sign in to comment.