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

bugfix/13780-tooltip-reversed-y #14432

Merged
merged 4 commits into from Sep 30, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion js/Core/Tooltip.js
Expand Up @@ -505,6 +505,7 @@ var Tooltip = /** @class */ (function () {
* @return {Highcharts.PositionObject}
*/
Tooltip.prototype.getPosition = function (boxWidth, boxHeight, point) {
var _a, _b;
var chart = this.chart, distance = this.distance, ret = {},
// Don't use h if chart isn't inverted (#7242) ???
h = (chart.inverted && point.h) || 0, // #4117 ???
Expand Down Expand Up @@ -545,7 +546,9 @@ var Tooltip = /** @class */ (function () {
]);
}, first = buildDimensionArray('y'), second = buildDimensionArray('x'),
// The far side is right or bottom
preferFarSide = !this.followPointer && pick(point.ttBelow, !chart.inverted === !!point.negative), // #4984
preferFarSide = !this.followPointer &&
!((_b = (_a = chart.hoverSeries) === null || _a === void 0 ? void 0 : _a.yAxis) === null || _b === void 0 ? void 0 : _b.reversed) && // #13780
pick(point.ttBelow, !chart.inverted === !!point.negative), // #4984
/*
* Handle the preferred dimension. When the preferred dimension is
* tooltip on top or bottom of the point, it will look for space
Expand Down
10 changes: 6 additions & 4 deletions ts/Core/Tooltip.ts
Expand Up @@ -895,10 +895,12 @@ class Tooltip {
first = buildDimensionArray('y'),
second = buildDimensionArray('x'),
// The far side is right or bottom
preferFarSide = !this.followPointer && pick(
point.ttBelow,
!chart.inverted === !!point.negative
), // #4984
preferFarSide = !this.followPointer &&
!(chart.hoverSeries?.yAxis?.reversed) && // #13780
pick(
point.ttBelow,
!chart.inverted === !!point.negative
), // #4984

/*
* Handle the preferred dimension. When the preferred dimension is
Expand Down