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
- [email protected] asked 10 years ago
- last edited 10 years ago
- You must login to post comments
I know this thread is a little old but I ended up solving exactly this issue. Here’s how I did it.
- Jason Neeley answered 8 years ago
- You must login to post comments
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
- Andrew Burnett-Thompson answered 10 years ago
- last edited 10 years ago
-
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.
-
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
-
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 login to post comments
Please login first to submit.