SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components
Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!
Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.
Hi, SciChart team.
Our users can add many VerticalLineAnnotations to chart. Also they need to know what annotation is active. It is usefull for annotation removing for example.
What way schould I use for change visual style for selected annotation. By default selected annotation do not differ with not selected.
At this time I am modify AddAdorners RemoveAdorners(I am use MyCustom Annotaion inherited from VerticalLineAnnotation). And use different colors. But names of theese methods confuse me.
May be it is good idea to add methods like MakeSelected and MakeUnselected. Documentation in chm file is not helpfull for this situation.
You could use Triggers or Binding to achieve this, e.g.:
<Style x:Key="VerticalLineAnnotationStyle" TargetType="s:VerticalLineAnnotation"> <Setter Property="Stroke" Value="#FFFF6600" /> <Setter Property="StrokeThickness" Value="2" /> <Setter Property="ShowLabel" Value="True" /> <Setter Property="LabelPlacement" Value="Axis" /> <Setter Property="VerticalAlignment" Value="Stretch" /> <Style.Triggers> <Trigger Property="IsSelected" Value="True"> <Setter Property="Stroke" Value="Blue" /> </Trigger> </Style.Triggers> </Style>
This can be done from code too. Please, let us know if this solution is suitable for you or if you need any assistance!
Please login first to submit.