Open cheryllaird opened 1 month ago
I don't think that relying on height
adapter will work.
Why not watch label's boundschanged
event instead?
Yeah good shout. I have updated to the boundschanged
event but I still can't seem to be able to get the rendered width of the label. The label width matches the width of the column so I am unable to detect when the text has overflowed.
I can't seem to be able to make this work. We will consider adding a functionality to auto-hide a wrapped label if it does not fit into maxWidth
.
Bug description Similar to this issue https://github.com/amcharts/amcharts5/issues/1632. I want to be able to measure the rendered with of a label.
On my bar chart I want the labels to wrap (using
oversizedBehavior: "wrap-no-break",
) but if any text overflows the column I want to be able to hide the label.In the codepen below you can see that I am trying to get the
_contentWidth
of the label in theAdd bullet(s)
section. However this is not always hiding the labels if it overflows the series on the bar when a single word overflows.Codepen: https://codepen.io/cheryllaird/pen/rNXWqeO