C3: Ability to show/hide mouseover tooltip via API

Created on 20 Aug 2014  路  8Comments  路  Source: c3js/c3

It would be great to be able to show and hide tooltips via a C3 API call. Something like chart.tooltip.show(), chart.tooltip.hide(). Each of those methods would then take a JSON object as its only parameter allowing the setting of the x-axis tooltip value to show/hide, position, and the particular dataset if tooltip grouping is turned off (with no parameters in .hide() meaning hide all).

It would enable developers an easy way to do something like what Datadog does in its time series charts where mousing over one chart also shows the same x-axis value of a different chart. A very important feature when comparing multiple charts that might have the same time range on the x-axis.

ref: http://vimeo.com/27541490 at about 1:05

C-feature-request resolved maybe

Most helpful comment

does this feature work on donut and or pie charts, if so how.

All 8 comments

This is the same thing I am after in #467

Hi, sorry for the late response.
I added tooltip.show and tooltip.hide. Please try these and check a sample here:
https://github.com/masayuki0812/c3/blob/master/htdocs/samples/api_tooltip_show.html

@masayuki0812 There appears to be a small issue when using the syntax chart.tooltip.show({ x: X_VALUE_HERE}) when the x-value is 0. However, using object { data: {x: 0} } seems to work fine.

@roydaniels You're right. Now it's been fixed now. Thank you!

This has been released, so please let me close.

Is this still working? I can't seem to get the tooltip to show or hide using the API at all -- I'm trying to conditionally show it for one data series but not for another one within the same chart, but the show/hide commands aren't working at all for me. (I tried with tooltip grouping set to both true and false, but neither one worked.)

does this feature work on donut and or pie charts, if so how.

Is it somehow possible to show/hide tooltip that I created through API tooltip.contents - not the default one?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aishwaryak picture aishwaryak  路  4Comments

zachallia picture zachallia  路  3Comments

DieterSpringer picture DieterSpringer  路  4Comments

u119102 picture u119102  路  3Comments

Zerim picture Zerim  路  3Comments