File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -238,7 +238,7 @@ export default class Labels {
238
238
if ( typeof yLbTitleFormatter !== 'function' ) {
239
239
yLbTitleFormatter = function ( label ) {
240
240
// refrence used from line: 966 in Options.js
241
- return label ? label + ': ' : ''
241
+ return label ? label + ': ' : ''
242
242
}
243
243
}
244
244
@@ -523,8 +523,7 @@ export default class Labels {
523
523
fn = fn [ i ]
524
524
}
525
525
526
- // override everything with a custom html tooltip and replace it
527
- tooltipEl . innerHTML = fn ( {
526
+ const customTooltip = fn ( {
528
527
ctx : this . ctx ,
529
528
series : w . globals . series ,
530
529
seriesIndex : i ,
@@ -533,5 +532,15 @@ export default class Labels {
533
532
y2,
534
533
w,
535
534
} )
535
+
536
+ if ( typeof customTooltip === 'string' ) {
537
+ tooltipEl . innerHTML = customTooltip
538
+ } else if (
539
+ customTooltip instanceof Element ||
540
+ typeof customTooltip . nodeName === 'string'
541
+ ) {
542
+ tooltipEl . innerHTML = ''
543
+ tooltipEl . appendChild ( customTooltip )
544
+ }
536
545
}
537
546
}
You can’t perform that action at this time.
0 commit comments