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

0
0

Hi,

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);
Version
4.2.0.4557
  • You must to post comments
0
0

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.

Best regards,
Yura

  • You must to post comments
0
0

Thanks Yura.

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?

Gang

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.