Maybe it's just me, but it seems like the tooltipFormat callback should allow formatting and returning the entire display string, not just the value.
Right now the tooltip always shows a color swatch, the data key, and then appends the formatted value.
I think the ability to format the entire string is important for a variety of reasons (custom localization, context-based messages, etc). Plus in my current usage it doesn't make sense to display a color swatch.
Is there another way to achieve this that I'm not aware of?
On a related note, it also seems like users should be able to disable tooltips. From what I can tell, this isn't possible (at least in Pie or Bar which are the only components I've tried so far).
@pvjones in your settings you can disable the tooltip this way:
isInteractive: false
@stahlmanDesign Lifesaver, thanks! I was wondering what isInteractive did! My bad for speaking before investigating more.
Also it would be nice to access x and y values instead of just y
Is it possible to access x and y both in the tooltip?
Duplicate of https://github.com/plouc/nivo/issues/117
@plouc Is it possible to access the x value on a tooltip? In the following example, id is y-axis and value is the value of the y-axis but how do we get the x-axis value?
tooltip={({ id, value, color }) => (
<div style={{ color: '#fff' }}>
{id}: {value}
</div>
)}
I'm able to access the data with
tooltip={(input) => {
console.log(input.point)
return (
<div>
hello
</div>
)}}
Most helpful comment
I'm able to access the data with