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. Image for the cookie policy date
close icon

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

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'





3 Replies

AB ab ba December 2, 2010 09:13 AM UTC

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 ab ba December 3, 2010 08:11 AM UTC

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)



LabelContentPath="DataPoint.Tag"
Visible="True"
SegmentShowLine="True"
SegmentHorizontalAlignment="Right"
SegmentVerticalAlignment="Top"
ConnectorTemplate="{StaticResource ConnectorTemplate}"
LabelTemplate="{StaticResource AdornmentLabelTemplate}"
SymbolTemplate="{StaticResource AdornmentSymbolTemplate}"/>







[this worked]


Margin="0"
Padding="2"
Background="Transparent"
BorderThickness="0"
Visibility="{Binding Converter={StaticResource AdornmentLabelTemplateVisibilityConverter}}">





[this didn't work]










SS Sujitha S Syncfusion Team December 6, 2010 08:45 AM UTC

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.

Regards,
Sujitha S




AdornmentInfo_1783a122.zip

Loader.
Live Chat Icon For mobile
Up arrow icon