We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

controlling the visibility of a chart series adorner in xaml based on each datapoint

Thread ID:





97483 Dec 1,2010 11:00 AM Dec 6,2010 03:45 AM WPF 3
Tags: Chart
ab ba
Asked On December 1, 2010 11:00 AM

I'd like to know if something like this is possible

Visible="{Binding Path=DataPoint.Tag.MyBooleanField}"
Symbol="Diamond" SymbolInterior="Crimson"
SymbolHeight="30" SymbolWidth="30"/>

I've simplified it a bit. I am guessing in real life I might need to use a converter.

My main question is: is it possible to show/hide the ChartAdornmentInfo based on a value within each DataPoint itself (such as 'MyBooleanField'

ab ba
Replied On December 2, 2010 04:13 AM

I noticed there is something called 'Annotation Shapes'... would it make any kind of difference to use those instead? are Annotation Shapes meant to be used when you need to control the appearance of each Data Point in the series?

ab ba
Replied On December 3, 2010 03:11 AM

there is probably a built-in way to do this but as I couldn't figure it out I ended up just making a template and then adding my own converter into the Visibility property of my template like this:

(note the AdornmentLabelTemplate is what worked in the end... but I wanted to do the same with the SymbolTemplate but never got that to work)

ConnectorTemplate="{StaticResource ConnectorTemplate}"
LabelTemplate="{StaticResource AdornmentLabelTemplate}"
SymbolTemplate="{StaticResource AdornmentSymbolTemplate}"/>

[this worked]

Visibility="{Binding Converter={StaticResource AdornmentLabelTemplateVisibilityConverter}}">

[this didn't work]

Sujitha S [Syncfusion]
Replied On December 6, 2010 03:45 AM

Hi Ab ba,

Thanks for your interest in Syncfusion product.

We have attached a simple sample to satisfy your requirement.

In the sample, I have used VisibilityConverter to set the visibility for the AdornmentLabelTemplate based on the DataPoint.

please find the attached sample and let me know, if it helps.

Sujitha S



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.