Skip to content

Conversation

etpinard
Copy link
Contributor

fixes #3654

updated codepen: https://codepen.io/etpinard/pen/bZJNBj

cc @plotly/plotly_js

@etpinard etpinard added bug something broken status: reviewable labels Mar 25, 2019
var overflowR = htx + txHalfWidth - outerWidth;
var overflowL = htx - txHalfWidth;
if(overflowR > 0) htx -= overflowR;
if(overflowL < 0) htx += -overflowL;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful! It makes sure we never have an overflow on the left which is perfect for languages that read left to right.

One day, we should allow reversing that order for languages that read right to left 😸

@antoinerg
Copy link
Contributor

Thank you for the fix @etpinard! It looks good to me 💃

@etpinard etpinard merged commit 577f831 into master Mar 26, 2019
@etpinard etpinard deleted the fit-hover-label-within-graph branch March 26, 2019 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pie chart hover label hidden
2 participants