Nivo: Ability to customize hovering label

Created on 5 Sep 2017  路  11Comments  路  Source: plouc/nivo

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)

pie tooltip enhancement

Most helpful comment

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 ?

All 11 comments

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

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! :)

@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. :sweat_smile:

@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!

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

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

@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 ?

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

@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.

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

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 ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Haaziq-Uvais picture Haaziq-Uvais  路  3Comments

dubzzz picture dubzzz  路  3Comments

luisrudge picture luisrudge  路  3Comments

tj picture tj  路  4Comments

serendipity1004 picture serendipity1004  路  3Comments