Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1725
UltraChart legend size
posted

I'm trying to figure out if there is a way to calculate the amount of space that legend items will take. My problem is that placing axis labels on charts with many points, the labels quickly become unreadable. So, I'm trying to use a legend. The issue here is that (again) if there are many items) the legend does not display all the items and does not seem to use the "MoreIndicatorText" when legend items don't fit. What I get instead is that the legend items are clipped at the chart legend right edge. What I'd like to be able to do is to determine the total horizontal and vertical space that the legends require and then be able to adjust font size and the SpanPercentage to get the items to all display. Is this possible or am I missing some other simple way to do this. 

Parents
No Data
Reply
  • 28496
    Offline posted

    The main factor in calculating the legend height is the legend font height ... multiply that by the number of items, add some pixels for margin, and you can predict its size.  I couldn't tell you the exact formula for that, though, as there are too many variables involved.

    Alternatively, you could just hide the legend and use the FillSceneGraph event handler to custom-draw a legend; it'll be more work but you'll have complete control so you'll be better suited to customize the legend sizing dynamically.

Children
No Data