I am building a distance versus elevation line chart from GeoJSON data, and I would like to edit the tooltip's style and content.
Specifically, I am wondering how to:
- have the tooltip in relative position underneath the graph in a more discreet way, rather than ovrlapping like it is right now
- round the distance value to 2 decimals
- remove the ',' thousands separator from the distance value
- add ' m' to the distance value
<LineChart
margin={{ top: 5, bottom: 30, left: 55, right: 0 }}
xAxis={[
{
min: Math.min(...xAxis),
max: Math.max(...xAxis),
data: xAxis,
valueFormatter: (element) => `${element} km`,
},
]}
yAxis={[
{
tickNumber: 5,
min: Math.min(...yAxis),
max: Math.max(...yAxis),
valueFormatter: (element) => `${element} m`,
},
]}
series={[
{
data: yAxis,
},
]}
/>