-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Legend cannot be scrolled to the end if xref
/yref
is set to container
#7072
Comments
My fix for // - if below/above plot area, give it the maximum potential margin-push value
// - otherwise, extend the height of the plot area
legendObj._maxHeight = Math.max(
(isBelowPlotArea || isAbovePlotArea) ? fullLayout.height / 2 : gs.h,
30
);
// _maxHeight is also limited by the container if it is anchored to it
if (legendObj.yref === 'container' && legendObj._maxHeight > 30) {
var yanchor = getYanchor(legendObj);
var containerAllowedHeight;
if (yanchor === 'top')
containerAllowedHeight = legendObj.y * fullLayout.height;
else if (yanchor === 'bottom')
containerAllowedHeight = (1 - legendObj.y) * fullLayout.height;
else // if (yanchor === 'middle')
containerAllowedHeight = 2 * Math.min(1 - legendObj.y, legendObj.y) * fullLayout.height;
legendObj._maxHeight = Math.min(containerAllowedHeight, legendObj._maxHeight);
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If a legend is anchored to the container, the container sizes aren't taken into account when the legend sizes are computed.
In the example codepen legends aren't visible fully and it is not possible to scroll then to the end.
function computeLegendDimensions should take into account the container sizes for calculation of
_maxHeight
and_maxWidth
The text was updated successfully, but these errors were encountered: