This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi Jason. In the Line Chart demo, yo've got the Legend showing Mark, Chris, and Samuel. What if I wanted to only show Mark and Chris, maybe by unchecking Samuel in the legend. Does Mindscape let me turn lines on/off in the charts, and if so, can you point me to an example? Thanks! |
|
|
Hello, I'm not Jason, but I just implemented that last night. You can turn on or off the Visibility on a line, you can bind that to a boolean value using the BoolToVisibilityConverter. It's working pretty well for me. Thanks B |
|
|
Hello Leah Bruce is right, you can hide/show series by setting the series Visibility property. Here is an example of creating a custom legend item template to display a CheckBox that affects the visibility:
The legend item template contains a CheckBox which directly binds to the visibility property of the legend items data series. I had implemented a simple converter called VisibilityToBooleanConverter to make this binding possible. This template is then used in the custom legend style which can be applied by setting the LegendStyle property of the Chart control. If you need your model to know/control the visibility state of each series, you'll also want boolean properties in your model which the Visibility property of the series can bind to - this time using a BooleanToVisibilityConverter. Let me know if you have any questions about this. -Jason Fauchelle |
|
|
Thanks Bruce and Jason, I will give it a whirl! Glad that it's so simple. |
|