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

Ability to customize hovering label #48

Closed
SammyIsra opened this issue Sep 4, 2017 · 11 comments
Closed

Ability to customize hovering label #48

SammyIsra opened this issue Sep 4, 2017 · 11 comments

Comments

@SammyIsra
Copy link

Hello! Is there currently a way to customize the label that shows in when one hovers over a section of a chart? For example, on the following Pie chart:
image
Say I want to display the number in a friendlier matter by formatting it the same way one formats the other labels (passing a string or a function that receives the node)

@plouc
Copy link
Owner

plouc commented Sep 5, 2017

Unfortunately, it's not possible for now, but it's a feature I'm planing to add, because it's a "must have".

@lapidus
Copy link

lapidus commented Oct 22, 2017

Any updates on this one? Would be super nice to have a single tooltip per line and dot in the Line charts too. The 'stacked tooltip' becomes a bit bulky with 10+ lines. Can we help out somehow? 👍
Thanks for a fabulous library! :)

@ahtohbi4
Copy link
Contributor

ahtohbi4 commented Nov 1, 2017

@SammyIsra, it will be possible after releasing a new version with this PR. The feature already is available in the master branch for components Bar, Bubble, Chord, HeatMap, Line, Pie, Radar, Sankey and Stream.

If I understood your issue correctly. 😅

@SammyIsra
Copy link
Author

@ahtohbi4 it seems like that's exactly what I was asking for! It seems you guys have a React Storybook set. Is it public? I'd love to see how the custom tooltips look and work, if possible!

@plouc
Copy link
Owner

plouc commented Nov 2, 2017

@SammyIsra, the storybook is available here: http://nivo.rocks/storybook/

@plouc
Copy link
Owner

plouc commented Dec 4, 2017

You can now format tooltip using tooltipFormat property, you can see it in action here

@plouc plouc closed this as completed Dec 4, 2017
@ramytamer
Copy link

@plouc I know I am little bit late to the party, but can't I access the index or the x value in the tooltipFormat function beside the value/y ?

@riteshnus
Copy link

@ramytamer did you find any hack to get the value x ?

@ramytamer
Copy link

@riteshnus After a quick glance on the code it turns out that the tooltipFormat function is called with one argument (the y value).

I can work on a PR if @plouc would accept this feature.

@riteshnus
Copy link

@ramytamer Did you PR accepted? got any solution around it

@plouc plouc added the 🍰 pie @nivo/pie package label May 9, 2018
@RParvathi
Copy link

Hi, Is there a way to customize tooltip and colors for ResponsiveSunburst ? Could you please share an example if available. Also, is there a Legend option for the Sunburst ?

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

No branches or pull requests

7 participants