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

Answered
0
0

When Im trying to remove an annotation, I’m receiving an error:

java.lang.NullPointerException: Attempt to invoke interface method
‘void
com.scichart.charting.visuals.annotations.IAnnotationPlacementStrategy.drawAdorner(android.graphics.Canvas)’
on a null object reference
at
com.scichart.charting.visuals.annotations.AnnotationBase.onDrawAdorner(SourceFile:889)
at
com.scichart.charting.visuals.annotations.AdornerLayer.onDraw(SourceFile:144)
at android.view.View.draw(View.java:17071)
at android.view.View.updateDisplayListIfDirty(View.java:16053)

I’ve tried many ways, like:

UpdateSuspender.using(priceChart, new Runnable() {
    @Override
    public void run() {
        priceChart.getAnnotations().clear();
    }
});

and

UpdateSuspender.using(priceChart, new Runnable() {
    @Override
    public void run() {
        priceChart.getAnnotations().remove(myAnnotation);
    }
});
Version
2.0.0.1884
  • You must to post comments
Best Answer
1
0

Hi Marcos,

I want to notify you that I’ve investigated and fixed this issue. It was caused by a small bug in our code – when you remove annotation from chart it doesn’t remove adorner for annotation if it is selected. The fix will be available in our next nightly build and for now you can workaround this issue by unselecting annotation before removing from collection:

UpdateSuspender.using(priceChart, new Runnable() {
    @Override
    public void run() {
        myAnnotation.setSelected(false);
        priceChart.getAnnotations().remove(myAnnotation);
    }
});

Hope this will help you!

Best regards,
Yura

  • You must to post comments
0
0

Thank you!

  • You must to post comments
0
0

This example is not working when the number of rows exceed the display size and needing scroll. When a row is scrolled out of view and back it becomes blanks and below errors are logged:

2020-07-16 12:23:48.909 25428-26052/com.scichart.examples E/BufferQueueProducer: [SurfaceTexture-0-25428-323] queueBuffer: BufferQueue has been abandoned
2020-07-16 12:23:48.909 25428-26052/com.scichart.examples E/Surface: queueBuffer: error queuing buffer to SurfaceTexture, -19
2020-07-16 12:23:48.909 25428-26052/com.scichart.examples I/Adreno: QueueBuffer: queueBuffer failed
2020-07-16 12:23:48.909 25428-26052/com.scichart.examples E/GLThread: eglSwapBuffers12301
2020-07-16 12:24:08.661 25428-26119/com.scichart.examples E/BufferQueueProducer: [SurfaceTexture-0-25428-350] dequeueBuffer: BufferQueue has been abandoned
2020-07-16 12:24:08.661 25428-26119/com.scichart.examples I/Adreno: DequeueBuffer: dequeueBuffer failed
2020-07-16 12:24:08.662 25428-26119/com.scichart.examples E/BufferQueueProducer: [SurfaceTexture-0-25428-350] dequeueBuffer: BufferQueue has been abandoned
2020-07-16 12:24:08.662 25428-26119/com.scichart.examples I/Adreno: DequeueBuffer: dequeueBuffer failed
2020-07-16 12:24:08.663 25428-26119/com.scichart.examples E/GLThread: eglSwapBuffers12301
2020-07-16 12:24:08.710 25428-26118/com.scichart.examples E/BufferQueueProducer: [SurfaceTexture-0-25428-349] queueBuffer: BufferQueue has been abandoned
2020-07-16 12:24:08.710 25428-26118/com.scichart.examples E/Surface: queueBuffer: error queuing buffer to SurfaceTexture, -19
2020-07-16 12:24:08.710 25428-26118/com.scichart.examples I/Adreno: QueueBuffer: queueBuffer failed
2020-07-16 12:24:08.711 25428-26118/com.scichart.examples E/GLThread: eglSwapBuffers12301
2020-07-16 12:24:08.778 25428-26104/com.scichart.examples E/BufferQueueProducer: [SurfaceTexture-0-25428-344] queueBuffer: BufferQueue has been abandoned
2020-07-16 12:24:08.778 25428-26104/com.scichart.examples E/Surface: queueBuffer: error queuing buffer to SurfaceTexture, -19
2020-07-16 12:24:08.778 25428-26104/com.scichart.examples I/Adreno: QueueBuffer: queueBuffer failed
2020-07-16 12:24:08.778 25428-26104/com.scichart.examples E/GLThread: eglSwapBuffers12301
2020-07-16 12:24:08.844 25428-26103/com.scichart.examples E/BufferQueueProducer: [SurfaceTexture-0-25428-343] queueBuffer: BufferQueue has been abandoned
2020-07-16 12:24:08.844 25428-26103/com.scichart.examples E/Surface: queueBuffer: error queuing buffer to SurfaceTexture, -19
2020-07-16 12:24:08.844 25428-26103/com.scichart.examples I/Adreno: QueueBuffer: queueBuffer failed
2020-07-16 12:24:08.844 25428-26103/com.scichart.examples E/GLThread: eglSwapBuffers12301
2020-07-16 12:24:08.994 25428-26102/com.scichart.examples E/BufferQueueProducer: [SurfaceTexture-0-25428-342] dequeueBuffer: BufferQueue has been abandoned
2020-07-16 12:24:08.994 25428-26102/com.scichart.examples I/Adreno: DequeueBuffer: dequeueBuffer failed
2020-07-16 12:24:08.994 25428-26102/com.scichart.examples E/BufferQueueProducer: [SurfaceTexture-0-25428-342] dequeueBuffer: BufferQueue has been abandoned
2020-07-16 12:24:08.994 25428-26102/com.scichart.examples I/Adreno: DequeueBuffer: dequeueBuffer failed
2020-07-16 12:24:08.996 25428-26102/com.scichart.examples E/GLThread: eglSwapBuffers12301

  • Yura Khariton
    Can you provide steps to reproduce this exception? What version of SciChart are you using?
  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.