dizzy
Posts: 79
Joined: Mon Aug 01, 2022 5:28 pm

Scatter plot series dont show in tooltip

Hi,
See this example: https://jsfiddle.net/dizzy0ny/3ukcexvh/277/

couple of issues:
1. if you however over a way with a scatterplot point, it does not show in the tooltip
2. the scatter plot points also fade while hovering over candles
2. if you do focus on a scatter point, the tooltip does show, but only the tool tip for the scatter point and the dates are still in epoch it seems, unformatted.
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: Scatter plot series dont show in tooltip

Hello,

1. If you hover over the scatter series, it does show in the tooltip in the top left corner as a series 2.
2. To turn off that feature, set series.scatter.states.inactive.enabled to false. The same can be done for candlestick series if you wish.
DEMO: https://jsfiddle.net/BlackLabel/cjeLn3zd/
API Reference: https://api.highcharts.com/highcharts/s ... s.inactive
3. To get a custom tooltip formatting for scatter series, use series.scatter.tooltip, or tooltip.formatter.
API References: https://api.highcharts.com/highcharts/s ... er.tooltip

Best regards!
Kamil Musiałowski
Highcharts Developer
dizzy
Posts: 79
Joined: Mon Aug 01, 2022 5:28 pm

Re: Scatter plot series dont show in tooltip

On #1, what i mean is that if you hover on an x-axis point that contains both the candle stick and scatter points, the scatter point doesn't render in the tooltip. for example in the below image, my mouse is over the date that contains the scatter plot. you see that volume, which is a different series, is rendered along with the ohlc data points in the tool tip in the upper left. but the scatter plot point is not
chart1.png
chart1.png (38.57 KiB) Viewed 450 times


On #3. i was under the impression that stockcharts render datetime epoch automatically, as is the case with the ohlc/candles stick data. but you're saying we need custom formatter in some cases, like scatter? should that be the case given that stock charts are almost always time series?
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: Scatter plot series dont show in tooltip

Hi there,

As it says in the API, scatter series do not support shared tooltip, so I've made a little workaround and changed the scatter series to line series (with line width set to 0). Now it supports the shared tooltip.
DEMO: https://jsfiddle.net/BlackLabel/7ugk9y2L/
API Reference: https://api.highcharts.com/highcharts/tooltip.shared

You can use the custom tooltip formatter if you want, but in your example, if you need the formatted date-time - it is already there, even for the scatter series, at the top of your tooltip.

Best regards!
Kamil Musiałowski
Highcharts Developer
dizzy
Posts: 79
Joined: Mon Aug 01, 2022 5:28 pm

Re: Scatter plot series dont show in tooltip

Thanks..interesting solution. it works, but in my case, when i hover on the marker - the line appears connecting them. no worries...will figure it out.
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: Scatter plot series dont show in tooltip

You're welcome! I haven't encountered the same in my demo. If you want to figure it by yourself, try to look into lineWidth, hover states or mouseTracking on the series.

Good luck!
Kamil Musiałowski
Highcharts Developer

Return to “Highcharts Stock”