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

0
0

Hi,

I am using VerticalLineAnnotation to point to a specific value of XAxis. I want to move this annotation by binding this X1 property and the SelectedX property of ViewModel. But even if SelectedX property was changed, the location of this annotation was not changed immediately. It was changed only after operating the chart (Zooming, etc).
Please let me know any solution to move an annotation immediately.

Thanks,

Version
5.1.1.11473
Images
  • Kenichi Kobayashi
    A long time has passed since the question was asked. Can you get a reply? It’s very troubled.
  • You must to post comments
0
0

Hi Kenichi,

Thank you for your patience while we investigate this problem.

The problem is that you have declared a non-default YAxisId in your code but have not specified the VerticalLineAnnotation.YAxisId.

You also do not need X2 binding, or to set Y0.

Try this instead:

   <s:VerticalLineAnnotation VerticalAlignment="Stretch"
                                      Foreground="Black"
                                      ShowLabel="True"
                                      Stroke="SkyBlue"
                                      StrokeThickness="2"
                                      X1="{Binding SelectedX.Value}"
                                      XAxisId="XAxis"
                                      YAxisId="YAxis"/> 

The annotation now updates correctly.

If you have non-default XAxis.Id or YAxis.Id then all annotations must have the XAxisId and YAxisId properties set (even vertical line annotation).

Best regards,
Andrew

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.