i wanna use vertical line annotation in box annotation that only one edge moves to drag like using ‘chart drag area to zoom’
I checked about custom annotation and there’s features said ‘common features of annotations’ but they don’t have any features l’m looking for
i put pictures for understanding.
there are box annotation on a graph and I want to move line to drag and box is going to smaller or larger
and i also want the other edge is fixed, it can not be dragged
do you guys have any tips for me?
- cy bang asked 4 years ago
- last edited 4 years ago
- You must login to post comments
Hi there,
Have you tried to combine box and 2 vertical line annotations, but make editable only vertical lines and drag only vertical lines? In this case you can set drag listener for vertical line and update position of box annotation based on position of vertical line ( set X1/X2 coords for box annotation to be equal to X1 coordinate of vertical line ). Also to provide effect of stretching box annotation vertically you can set relative coordinate mode in Y direction, then set Y1 = 0 and Y2 = 1 for annotation.
Is this suitable for your needs?
Best regards,
Yura
- Yura Khariton answered 4 years ago
-
that is the one way to drag vertical line on box! thx for your help but i wonder that is the only one way to make a box dragging line? you might see ‘Drag Area to Zoom’, i know that is zoom modifier, but it looks almost same that i want. i mean looks like how it works when i drag vertical line, box(just looks like) is being large the one way
-
Well I think that this is the easiest way to implement desired output, because it doesn’t require customization of chart and creating custom classes. Of course this can be done in differen way – for example you can create custom annotation ( e.g. extend vertical line annotation, override it’s onDraw() and draw filled area there, or extend box annotation and draw line there, or use custom background Drawable for box annotation with line in it ). Or you can do this using ChartModifiers API like we do in RubberBandXyZoomModifier, where we use simple custom View and change it layout params based on touch events. To do this you can create custom modifier (https://www.scichart.com/documentation/android/current/webframe.html#Custom%20Modifiers%20-%20ChartModifierBase%20API.html) and move annotation or custom View when some touch event occurs.
- You must login to post comments