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
945
Changing LegendItemVisibility has no effect
posted

Would like to remove some of my series from displaying in the legend.

Have set LegendItemVisibility to Collapsed, with no effect.

Then tried to bind it to a property, can not change the value appears to be read-only

Any ideas

Parents
  • 17475
    Offline posted

    Hello David, 

    Thank you for posting! 

    I have been looking into your scenario and created a sample project based on the description. On my side, setting the LegendItemVisibility to Collapsed for some of the series restrict them from showing in the legend.

    Another approach that could be used here is creating a template for legend items and using a converter. In the attached project the converter “SeriesToVisibilityConverter” returns Visibility.Collapsed if Series Title is “Series 1” and if LegendItemVisibility property of the series is not set only “Series 1” would be visible.

    I hope this helps. If you have any questions, please feel free to let me know.

    XamDataChartHorizontalLegend (1).zip
Reply Children