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

Tooltip improvements #92

Open
Fxlr8 opened this issue Aug 23, 2017 · 2 comments
Open

Tooltip improvements #92

Fxlr8 opened this issue Aug 23, 2017 · 2 comments

Comments

@Fxlr8
Copy link

Fxlr8 commented Aug 23, 2017

  1. I tried to use onMouseMove prop on SparklinesLine component but found it very hard to hit tiny circles that it generates
return (
        <circle
          key={i}
          cx={p.x}
          cy={p.y}
          r={2}
          style={fillStyle}
          onMouseEnter={e => onMouseMove('enter', data[i], p)}
          onClick={e => onMouseMove('click', data[i], p)}
        />
      );

How do you think users should snipe those 2px circles whit a cursor? I think microscopic hardcoded circles are not the best way to trigger tooltip callback, how about rendering transparent rectangles over the chart?

  1. The callback function does not return the index of the hovered point, which could be very handy if you want to render a custom tooltip and display more data.

  2. There is a bug if you set fill to none in SparklinesLine style the callback function never gets triggered.

I can implement and fix all that stuff if you let me

@SalmaanP
Copy link

SalmaanP commented Sep 25, 2017

@Fxlr8 Hey, can you post a snippet of how you used onMouseMove? I'm having trouble understanding how to use it, the docs don't have information for it. Thanks!

@sampathmo
Copy link

Hi, can you post snippet for showTooltip ? onMouseMove

@rrjanbiah rrjanbiah mentioned this issue Jan 10, 2020
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

3 participants