I am trying to add text annotation on the chart but it doesn’t show. I’m wondering what went wrong with my code.
TextAnnotation textAnnotation = sciChartBuilder.newTextAnnotation() .withText("hello") .withX1(450) .withY1(1) .withFontStyle(20, Color.WHITE) .build(); ecgSurface.getAnnotations().add(textAnnotation);
Hi Gang Xu,
Is it possible that your X1 or Y1 coordinates are outside of VisibleRange for X or Y axis? If annotation is placed outside chart’s viewport bounds, then it won’t be visible. Also I would suggest to check logcat output if there are any errors there.
I just figured out the reason for annotation not showing up, which is because the AxisID. I defined XAxisID for the chart and the annotation works if I add withXAxisID(“ecgX”) in the code.
Except this, may I ask if there’s an efficient way to add hundreds of annotations at a time?
And is there a way to make an annotation selectable but not movable or resizable?
Also I noticed the annotations were off the position where they were supposed to be when I dragging the chart. Is that how it works?
Please login first to submit.