Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooltip not working correctly after window resize and scrollablePlotArea must be enabled #17352

Closed
JoeyLi-1 opened this issue Jun 2, 2022 · 2 comments · Fixed by #17371
Closed
Assignees

Comments

@JoeyLi-1
Copy link

JoeyLi-1 commented Jun 2, 2022

Expected behaviour

Tooltip works fine. Look like this.
image

Actual behaviour

Tooltip missing.
image

Live demo with steps to reproduce

Repo steps:
1 click button "small";
2 open console to force redrew;
3 minimize the console panel
4 click button “large”;
5 open console to force redrew;
6 minimize the console panel
7 you can see part of the tooltip disappeared.
(Seems only V-Scrollbar could cause this issue)

This demo is similar but not exactly same as our case. In our case, after resize the window, some of the tooltip disappear totally. And if
you set a positioner callback function, some tooltip will trigger that function while others don`t. The "top" property of the missing tooltip will be "-9999px".

Product version

v10.1.0

Affected browser(s)

I just tested it on chrome.

PS: I am new to JSFiddle, Just copy the code here in case the demo not working.
HTML:
`

<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="https://code.highcharts.com/highcharts.js"></script>
Large Small `

JS:
function onLarge() { $('#container').css("height","400px") } function onSmall() { $('#container').css("height","190px") }

chart: {
type: 'spline',
scrollablePlotArea: {
minHeight: 200,
scrollPositionX: 1
}
},

I Just change a little bit of the official demo.
https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/chart/scrollable-plotarea

Thank you for your time!

@karolkolodziej
Copy link
Contributor

Thank you for reporting that issue.
Simplified demo: https://jsfiddle.net/BlackLabel/buqezt6n/

Internal note:
This condition in the tooltip refresh method is failing and resulting in hiding that tooltip.

highcharts/ts/Core/Tooltip.ts

Lines 1112 to 1117 in 0146821

if (
chart.polar ||
currentSeries.options.clip === false ||
points.some((p): boolean => // #16004
p.series.shouldShowTooltip(checkX, checkY)
)

The direct cause of that behavior is visible in isInsidePlot where incorrect scrollablePlotBox is taken.

We should investigate how the scrollablePlotBox is being set after reflow.

@karolkolodziej
Copy link
Contributor

Edit:
Bisected to commit 9b58c8a
Works well in v9.0.1 and lower

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants