You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a CustomLegend the sizing of the legend is not well supported.
If the custom legend children apply a margin, the computed legend size is smaller than what the actual legend takes up causing the chart canvas to be pushed out of the container.
If the custom legend children height is larger than 34px, The legend will overflow into the chart canvas element.
With our built-in legend we are able to compute the height/width without the need to call getBoundingClientRect. But with the custom legend I think this should be flexible and we should size the chart based on the dynamic size of the legend the user passes.
The text was updated successfully, but these errors were encountered:
Describe the issue
When using a
CustomLegend
the sizing of the legend is not well supported.If the custom legend children apply a margin, the computed legend size is smaller than what the actual legend takes up causing the chart
canvas
to be pushed out of the container.If the custom legend children height is larger than
34px
, The legend will overflow into the chartcanvas
element.To Reproduce
Steps to reproduce the behavior:
div
wrapping the custom legend component, overly constraining the custom legend.Expected behaviour
Custom legend is sized based on the element passed to charts
Screenshots
Additional context
For the
CustomLegend
we wrap the passed element with adiv
which we can custom sizing styles.elastic-charts/packages/charts/src/components/legend/legend.tsx
Lines 117 to 120 in 3bddec8
With our built-in legend we are able to compute the height/width without the need to call
getBoundingClientRect
. But with the custom legend I think this should be flexible and we should size the chart based on the dynamic size of the legend the user passes.The text was updated successfully, but these errors were encountered: