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,
- Kenichi Kobayashi asked 5 years ago
- last edited 5 years ago
-
A long time has passed since the question was asked. Can you get a reply? It’s very troubled.
- You must login to post comments
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
- Andrew Burnett-Thompson answered 5 years ago
- You must login to post comments
Please login first to submit.