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!

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

Are there any examples existing for creating a custom annotation which consists of an arrow and a textbox. It would also be useful if the position of the text box / end of arrow could be changed by dragging the annotation. Attached is an image of the kind of thing I am trying to achieve.
I need to add these annotations dynamically as the user clicks on a point.

Images
  • You must to post comments
0
0

You need to bind their coordinates, please, try following this way:

                <s:LineArrowAnnotation HeadLength="4"
                                       HeadWidth="8"
                                       IsEditable="False"
                                       X1="50"
                                       Y1="35"
                                       X2="{Binding X1, ElementName=txt}"
                                       Y2="{Binding Y1, ElementName=txt}" />

                <s:TextAnnotation IsEditable="True"
                                  x:Name="txt"
                                  Text="Buy!"
                                  X1="10"
                                  Y1="30.5" />

Is it something like you want to achieve?

Best regards,
Yuriy

  • BeckyHayter
    Yes this is similar to what I want to achieve. However I need to be able to add the annotations dynamically at runtime and I do not know how many of them there will be. This means I cannot declare them in the xaml (except for possibly using a control template).
  • Andrew
    Hi Becky,The equivalent code for the above is sciChartSurface.Annotations.Add(new TextAnnotation(){ X1 = ... Y1 = ...});You can bind in code, or just set the data-values. I'm sure you've seen it but there is a good tutorial on annotations and their properties here.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.