react-timeseries-charts icon indicating copy to clipboard operation
react-timeseries-charts copied to clipboard

Remove the time from the tracker/tooltip?

Open acomito opened this issue 5 years ago • 3 comments

❔Question

I'm looking to format the time on the tooltip. Right now I'm using a scatter plot on top of a line chart

Screen Shot 2020-03-25 at 12 31 15 PM

I see a few props but none seemed to work... trackerShowTime, showTime, etc... I tried passing them into ScatterChart, CartRow, and ChartContainer but they didn't seem to effect the tooltip's datetime format.

Your Environment

"react-timeseries-charts": "^0.15.5",

acomito avatar Mar 25 '20 16:03 acomito

Maybe related to this

https://github.com/esnet/react-timeseries-charts/issues/286

acomito avatar Mar 25 '20 16:03 acomito

this doesn't appear possible. TimeMarker has a showTime prop

https://github.com/esnet/react-timeseries-charts/blob/aa9c9b368100d78337b562d9e2833f2d90d9de3d/src/components/TimeMarker.js#L183-L186

which defaults to true.

https://github.com/esnet/react-timeseries-charts/blob/aa9c9b368100d78337b562d9e2833f2d90d9de3d/src/components/TimeMarker.js#L213

when it's rendered by ChartContainer, no prop is passed thru, so we're locked into the default value:

https://github.com/esnet/react-timeseries-charts/blob/aa9c9b368100d78337b562d9e2833f2d90d9de3d/src/components/ChartContainer.js#L424-L435

brandly avatar Sep 05 '20 15:09 brandly

i guess it might be possible to not specify a tracker on the ChartContainer, and then render your own TimeMarker with showTime=false. the official TimeMarker is rendered with this surrounding transform, so i'm not sure if there would be alignment issues:

https://github.com/esnet/react-timeseries-charts/blob/aa9c9b368100d78337b562d9e2833f2d90d9de3d/src/components/ChartContainer.js#L419-L424

i'll try to loop back if i go down this route, but it's not a high priority at the moment.

brandly avatar Sep 05 '20 16:09 brandly