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

When using tooltip.outside, tooltip gets misaligned #16944

Closed
rizzotto opened this issue Feb 1, 2022 · 4 comments · Fixed by #16956
Closed

When using tooltip.outside, tooltip gets misaligned #16944

rizzotto opened this issue Feb 1, 2022 · 4 comments · Fixed by #16956

Comments

@rizzotto
Copy link

rizzotto commented Feb 1, 2022

Expected behavior

Tooltip should not get misaligned when using outside: true property

Actual behavior

Tooltip is not aligned properly when using the outside prop

Live demo with steps to reproduce

Check the demo example https://jsfiddle.net/rizzotto/urhkswtj/ and set the property outside to true

tooltip

@raf18seb
Copy link
Contributor

raf18seb commented Feb 2, 2022

Hi @rizzotto, thank you for reporting a bug!

Internal note:
The tooltip's position is not being corrected by tooltip.distance in the tooltip.updatePosition() method when tooltip.outside is true.

Workaround: correct the position with this pos.x -= this.distance / 2;: https://jsfiddle.net/BlackLabel/yfxp9hkL/
The issue is visible only with tooltip.positioner

@rizzotto
Copy link
Author

rizzotto commented Feb 3, 2022

Hey @raf18seb thanks for answering, also the Y is misaligned.

Do you have an ETA for this one?

Thanks!

@raf18seb
Copy link
Contributor

raf18seb commented Feb 3, 2022

We are preparing for the v10 release now, so no specific ETA for this bug, sorry. I'll put it into our development flow (Inbox tag).
If you're our licensed customer, please contact us at support@highcharts.com with your license ID, then we'll try to speed it up.

@TorsteinHonsi
Copy link
Collaborator

TorsteinHonsi commented Dec 13, 2022

The connection to distance in the OP demo is probably a coincidence. Instead, I think it's about the chart's position in the page. The positioner is not corrected for the chart position.

Workaround

        positioner(labelWidth, labelHeight, point) {
            const chartPosition = this.chart.pointer.getChartPosition();
            return {
                x: chartPosition.left + point.plotX + this.chart.plotLeft - labelWidth / 2,
                y: chartPosition.top + this.chart.plotTop - 20,
            }
        },

View it live on jsFiddle

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.

5 participants