Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the time from the tracker/tooltip? #440

Open
acomito opened this issue Mar 25, 2020 · 3 comments
Open

Remove the time from the tracker/tooltip? #440

acomito opened this issue Mar 25, 2020 · 3 comments

Comments

@acomito
Copy link

acomito commented Mar 25, 2020

❔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
Copy link
Author

acomito commented Mar 25, 2020

Maybe related to this

#286

@brandly
Copy link
Contributor

brandly commented Sep 5, 2020

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

* You can hide the time displayed above the info box. You might do this because
* it is already displayed elsewhere in your UI. Or maybe you just don't like it.
*/
showTime: PropTypes.bool,

which defaults to true.

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

<TimeMarker
width={chartsWidth}
height={chartsHeight}
showInfoBox={!!this.props.trackerValues}
time={this.props.trackerPosition}
timeScale={timeScale}
timeFormat={this.props.format}
infoWidth={this.props.trackerHintWidth}
infoHeight={this.props.trackerHintHeight}
infoValues={this.props.trackerValues}
infoStyle={trackerStyle}
/>

@brandly
Copy link
Contributor

brandly commented Sep 5, 2020

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:

<g
key="tracker-group"
style={{ pointerEvents: "none" }}
transform={`translate(${leftWidth + paddingLeft},${paddingTop + titleHeight})`}
>
<TimeMarker

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants