highcharts / highcharts

Highcharts JS, the JavaScript charting framework
https://www.highcharts.com
Other
11.99k stars 3.61k forks source link

BOOST: tooltip doesn't show for columns that are out of plotarea #16881

Open raf18seb opened 2 years ago

raf18seb commented 2 years ago

Expected behaviour

I expect the tooltip to be shown just the same as in non boosted chart: https://jsfiddle.net/BlackLabel/387kuhej/

Actual behaviour

When boost is on, the tooltip doesn't show for columns that end out of the plotarea.

Live demo with steps to reproduce

https://jsfiddle.net/BlackLabel/mycxs3qw/

Product version

Highcharts 9.3.2

It's caused by the boost module that sets series.directTouch = false; https://github.com/highcharts/highcharts/blob/85c13f6904d7fd005336bfa8d9743e026778454a/ts/Extensions/Boost/BoostOverrides.ts#L485

Because of that, the column points that end out of the plotarea are not added to the kdTree: https://github.com/highcharts/highcharts/blob/85c13f6904d7fd005336bfa8d9743e026778454a/ts/Core/Series/Series.ts#L3615-L3620

Workaround: https://jsfiddle.net/BlackLabel/wkv2h6s8/

Workaround is with series.clip: false to allow displaying the tooltip. It's not needed with tooltip.followPointer. It comes from here: https://github.com/highcharts/highcharts/blob/85c13f6904d7fd005336bfa8d9743e026778454a/ts/Core/Tooltip.ts#L1116

jellevv1 commented 1 year ago

We are having the same issues but setting clip to false rendered our line through the legend. Clearly this is not an option for us 2023-09-12 11_52_44-Window https://jsfiddle.net/fctuh24r/

We are using Highstock from highcharts version 11.1.0

Are there other workarounds?

karolkolodziej commented 1 year ago

Hi @jellevv1!

If you are sure that the tooltip should be visible for points that are not in the plot area you can overwrite the shouldShowTooltip method - demo.