Hi,
I am trying to have a check box in legend against each series and on uncheck I want my series hidden. Is it possible or not please suggest a solution thanks.
Hello,
This can be accomplished by retemplating a series' LegendItemTemplate to contain a check box. Once you have this, you can then bind the check box's IsChecked property to the Series.Visibility property. Please note, however, that you'll also have to implement a value converter that can convert from the Visibility enumeration to a boolean value.
I have attached a small sample that demonstrates how all of this can be accomplished. Please let me know if you have any further questions or concerns about this matter.
Hi Jason,
Thanks for your reply and the solution. I am exactly looking for the same behaviour but I want my check box to bind with my VM or Presenters property and in this case its picking things only from series. Can you suggest something in this regard, I belive one way of achieving is to introduce an other dependency property for series. I tried by binding Visible property with my VM's Property and Check box with visibililty property of series but its not working.
Yup its working fine now. Thanks for youir help.
Do you have any further questions or concerns about implementing the series check boxes?
Bind the Visibility of the Series to the Visibility property in your ViewModel with the Mode set to TwoWay. Then, if you leave the CheckBox binding as it was in my sample the CheckBox will get its value from the Series.Visibility which gets its value from the ViewModel. If you change the value of the CheckBox it will set the Series.Visibility and propagate that back to ViewModel as well.