Hello,
I'm interested in selectively showing or hiding labels for specific datapoint in my series. I have a column called 'LabelVisible' on the underlying data in my view model that contains a boolean value designed to control the datapoint's label visibilty in the series. True means the label should be visible on the data point, false means that the label should not be displayed.
The underlying data is bound to the series via the ItemsSource property on the chart.
I haven't found a way to control the visibility of individual labels at the data point level - it seems to be an all or nothing option for the entire series through the ShowItemLabels property on the LineSeriesDefinition and AreaSeriesDefinition that I use in this case.
Based on other forum posts, I'm assuming I need to go with a custom template for the item label object and bind its visibility to my boolean column via a converter. However I'm not sure which object I need to re-template, nor how to setup the new template so objects in it bind to a property that isn't in the template (TemplateBinding) but in the underlying bound data.
An example on how to do this would be great - unless a simpler solution exists.
Regards,
EM
I'm interested in selectively showing or hiding labels for specific datapoint in my series. I have a column called 'LabelVisible' on the underlying data in my view model that contains a boolean value designed to control the datapoint's label visibilty in the series. True means the label should be visible on the data point, false means that the label should not be displayed.
The underlying data is bound to the series via the ItemsSource property on the chart.
I haven't found a way to control the visibility of individual labels at the data point level - it seems to be an all or nothing option for the entire series through the ShowItemLabels property on the LineSeriesDefinition and AreaSeriesDefinition that I use in this case.
Based on other forum posts, I'm assuming I need to go with a custom template for the item label object and bind its visibility to my boolean column via a converter. However I'm not sure which object I need to re-template, nor how to setup the new template so objects in it bind to a property that isn't in the template (TemplateBinding) but in the underlying bound data.
An example on how to do this would be great - unless a simpler solution exists.
Regards,
EM