SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components

0
0

Can Annotation in editing state set the editing style, or the background of editing state?

Version
2.1.0.2210
  • You must to post comments
0
0

like this picture,Can Annotation in editing state set the editing style, or the background of editing state?

Images
  • You must to post comments
0
0

Hi Huang Haiyan,

I’m not sure that I understand what you mean. If you want to customize appearance of annotation when it’s selected, then yes, it’s possible to do. You can set AnnotationSelectionDrawable which is responsible for drawing overlay on top of annotation when it’s selected. Also you can customize ResizingGrips ( those round circles which you can drag to resize annotation ).

annotation.setAnnotationSelectionDrawable(new DefaultAnnotationSelectionDrawable(Color.BLUE, 0.8f, 4f));
annotation.setResizingGrip(new EllipseResizingGrip(Color.BLUE, 10, Color.RED, 30));

Also you can try to add OnAnnotationSelectionListener for annotation and try to change annotation properties based on IsSelected value:

annotation.setOnAnnotationSelectionChangeListener(new OnAnnotationSelectionChangeListener() {
@Override
public void onSelected(IAnnotation annotation) {
    final BoxAnnotation boxAnnotation = (BoxAnnotation) annotation;
    boxAnnotation.setBackgroundResource(R.id.selectedBackground);
}

@Override
public void onUnselected(IAnnotation annotation) {
    final BoxAnnotation boxAnnotation = (BoxAnnotation) annotation;
    boxAnnotation.setBackgroundResource(R.id.unselectedBackground);
}
});

Is this suitable for you?

Hope this will help you!

Best regards,
Yura

  • You must to post comments
0
0

No, I mean to change the background of the editing status, the white circle, and the red translucent border.

  • Yura Khariton
    Well AnnotationSelectionDrawable is responsible for drawing of border and ResizingGrip for drawing of white circles. Please try to change them like I suggested in my previous reply
  • Huang haiyan
    Yes,It is what I want ! Thanks
  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.