SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Welcome to the SciChart Community Forums!

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!

0
0

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 must to post comments
0
0

Hi there,

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!

Best regards,
Yuriy

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.