Commit ce96ac07 authored by GermainBergeron's avatar GermainBergeron

Fixes #1192

Added onshow and onhide functions on tooltip
parent ae26e98e
......@@ -28,8 +28,12 @@ c3_chart_fn.tooltip.show = function (args) {
// emulate mouse events to show
$$.dispatchEvent('mouseover', index, mouse);
$$.dispatchEvent('mousemove', index, mouse);
config.tooltip_onshow.call($$, dataToShow);
};
c3_chart_fn.tooltip.hide = function () {
// TODO: get target data by checking the state of focus
this.internal.dispatchEvent('mouseout', 0);
config.tooltip_onhide.call(this);
};
......@@ -192,6 +192,8 @@ c3_chart_internal_fn.getDefaultConfig = function () {
tooltip_init_show: false,
tooltip_init_x: 0,
tooltip_init_position: {top: '0px', left: '50px'},
tooltip_onshow: function () {},
tooltip_onhide: function () {},
// title
title_text: undefined,
title_padding: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment