SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & 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!

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.

0
0

Hi!

I am trying out a feature in my application with editable vertical lines annotations. My problem is that my set method needs to perform some calculations when the vertical line is moved, and since the set method is being called multiple times when moving the annotation, it slows it down and doesn’t give the user that great feeling that it should

Is there any way of delaying the set method being called until the user actually drops the annotation?

  • You must to post comments
0
0

Hello Lisbeth,

There aren’t other solutions for now, so please, find a template for the VerticalLineAnnotation here:

    <Style TargetType="SciChart:VerticalLineAnnotation">
        <Setter Property="LabelTextFormatting" Value="{Binding ParentSurface.XAxis.TextFormatting, RelativeSource={RelativeSource Self}}" />
        <Setter Property="LabelTextFormatting" Value="{Binding XAxis.TextFormatting, RelativeSource={RelativeSource Self}}" />
        <Setter Property="Stroke" Value="{StaticResource RubberBandStrokeBrush}" />
        <Setter Property="StrokeThickness" Value="2.0" />
        <Setter Property="LabelValue" Value="{Binding X1, RelativeSource={RelativeSource Self}}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="SciChart:VerticalLineAnnotation">
                    <Grid x:Name="PART_VerticalLineAnnotationRoot">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>

                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>

                        <Line x:Name="PART_GhostLine"
                              Grid.Row="1"
                              Grid.Column="1"
                              HorizontalAlignment="Center"
                              Stretch="Fill"
                              Stroke="Transparent"
                              StrokeThickness="11"
                              X1="0"
                              X2="0"
                              Y1="0"
                              Y2="1" />

                        <Line x:Name="PART_Line"
                              Grid.Row="1"
                              Grid.Column="1"
                              HorizontalAlignment="Center"
                              Stretch="Fill"
                              Stroke="{TemplateBinding Stroke}"
                              StrokeDashArray="{TemplateBinding StrokeDashArray}"
                              StrokeThickness="{TemplateBinding StrokeThickness}"
                              X1="0"
                              X2="0"
                              Y1="0"
                              Y2="1" />

                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

You could modify it as described in posts I’ve pointed to. Please, let us know if you need further assistance with this.

Best regards,
Yuriy

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.