Pre loader

How to move vertical line annotation by MVVM command

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

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
Attachments
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.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies