Reputation: 442
So I am using C3 to create a line chart which looks like this:
Now I have to hide the tooltip when the value on the chart is zero. I can't find any solutions online or on the documentation of C3.
Please help. Thank you.
Upvotes: 1
Views: 616
Reputation: 192
You can modify the tooltip.contents
function for that. It modifies the HTML of the tooltip according to your needs.
According to the docs:
tooltip.contents
Specified function receives
data, defaultTitleFormat, defaultValueFormat
andcolor
of the data point to show. Iftooltip.grouped
istrue
,data
includes multiple data points.
The documentation explains it clearly here: C3 Docs - Tooltip Contents
You can see an example on this fiddle I made: JSFiddle
Hope I could help!
Upvotes: 1