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.

1
0

Hi, I am displaying no of BoxAnnotation , I want to link some of the BoxAnnotation randomly .I want to perform the operaton on annotation with relation.When it move BoxAnnotation,related link should also move accordingly.I am also performing Y axis with yaxisID so Annotation also move to Y direction with Y axis.
Please help me out.
Thanks

Images
  • You must to post comments
1
0

I know this thread is a little old but I ended up solving exactly this issue. Here’s how I did it.

  • You must to post comments
0
0

BoxAnnotation has four properties, X1, Y1, X2, Y2, which define its position in data-coordinates. A LineAnnotation also has four properties, X1, Y1, X2, Y2, which define its position in data-coordinates.

All these properties are DependencyProperties, so, you can get notification when they change via one of the following methods:

  • TwoWay binding to a property in a ViewModel, or directly TwoWay Binding between the elements in XAML
  • DependencyPropertyChanged notification using a method as described here

Knowing the above it should be easy for you to link up the movement of BoxAnnotations with LineAnnotations!

Best regards,
Andrew

  • sonu91@gmail.com
    Thanks Andrew for your response.I am able to do the same movement with x-axis,but when I am moving y-coordinate via mouse drag , the two different linked box annotation fail to link as I have attached in the picture.
  • sonu91@gmail.com
    Hi Andrew, Please see the picture, Here one boxannotation attached with first Yaxes ,one LineAnnotation & BoxAnnotation attached to second Yaxes with YAxisDragModifier. when I am moving second YAxes coordinate using mouse drag,it detches ,But I want to make it linked .Here when I am moving mouse drag of YAxes I find no change in Y1,Y2.Please tell me on which basis I can Link them. Please tell me it is possible or not.I have attached the 2nd pic
  • Andrew
    Hi there, ok if you have the annotations, the X1,Y1,X2,Y2 properties, you need to listen to changes using DependencyPropertyChanged notification and align the boxes. Having the boxes on different YAxisIds adds complexity here. Now you are going to need to transform the coordinates between the two YAxes. This is possible using our Pixel to Coordinate transformation API: http://support.scichart.com/index.php?/Knowledgebase/Article/View/17207/31/convert-pixel-to-data-coordinates. With different annotations on different axes, there's no way you can do this without subscribing to events and aligning the boxes in code. But it should be possible. Let me know if this helps ..
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.