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
645
Equally spacing out the legend items
posted

I am displaying a legend for my XamDataChart to the left of the chart.  It is as tall as the chart and what I'd like to do is spread the legend entries so that they are equally spaced vertically.  Right now they start at the top of the legend and there is a good deal of whitespace at the bottom, particularly when the chart window is maximized.

How can I spread out these entries so that they take up the full space?  I don't need them to be any larger ( the marker and font size are fine), just want them to spread out rather than being bunched up.

Thanks,

Matt

  • 27093
    posted

    Hello Matt,

    I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.

    If the above suggestions helped you solve your issue please verify the thread as answered so other users may take better advantage of it.

    Sincerely,
    Petar Monov
    Developer Support Engineer
    Infragistics Bulgaria
    www.infragistics.com/support

     

  • 1400
    Verified Answer
    Offline posted

    Hi Matt,

    I've modified Marisa's sample project and I added style in order to position legend items in the center of the Legend. This should avoid whitespace at the bottom of the legend.

    Let me know if you have more questions about this.

    Martin

  • 1134
    Suggested Answer
    posted

    Hi Matt,

    I've attached a sample project here demonstrating what I think will resolve your issue.  I've included a LegendItemTemplate in the resources of my MainWindow and increased the margin of the StackPanel within the template to add additional space.  If you set this template to the LegendItemTemplate property of each of your series that show in the Legend, they should show up as equally spaced inside of the legend.

    Let me know if this helps!

    Marisa

    WpfApplication31.zip