Pre loader

Adding images to android chart

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

Answered
1
0

Hi all,

Bit of a weird question here again – sorry.

I’m not sure if this is possible, but I’m looking to have an android device take pictures every x minutes, and I’d like to display them in a chart with a shared axis with a few other charts. A user will ideally be able to see each of these snapshots associated with the time that they’re taken, and on press expand them into a carousel view with the selected image as the current.

The on press and carousel bit will be straight android code, but I was wondering about displaying images on charts – is it possible? I poked around a little bit, and for WPF, I saw

https://www.scichart.com/questions/question/rendering-2d-camera-images

I was wondering if the android libraries can do similar, and if so, do you have any examples/code snippets?

The other potential approach I found was using the Sprite point marker API, although I’m not sure the scope of images it can render?

Would either of these approaches be feasible, and do you have any examples/tips? Attached is the current status of my charts, and I’m hoping to put images in the red boxes on the second chart (I just put a column chart as a placeholder there for the moment).

Also, I just wanted to say thanks for all the fantastic support your team has provided.

Thanks,
-Andy

Version
2.2.2.2424
Images
  • You must to post comments
Best Answer
2
0

Hi Andrew,

If amount of images isn’t very large then you can use our Annotation API to do it. You can use BoxAnnotation and place ImageView inside it or also you can set that image as background Drawable for BoxAnnotation.

If you need to draw many images (e.g 100 or more) then you can use RenderContext API which will allow to avoid overhead caused by using of Android Views for annotations. In this case you can implement drawing of images as custom renderable series. You can extend one of existing series or create completely new series from scratch. I would suggest you to take a look on this and this examples which show how to create custom series. To draw texture in custom renderable series you can use next code:

    @Override
    protected void internalDraw(IRenderContext2D renderContext, IAssetManager2D assetManager, ISeriesRenderPassData renderPassData) {

    final IPixelTexture2D texture = assetManager.createTexture(bitmap);

    renderContext.drawTexture(texture, x1, y1, x2, y2);
}

Hope this will help you!

Best regards,
Yura

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies