Pre loader

IllegalArgumentException in Log when using CanvasRendering surface

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

Closed
1
0

Hey,

I’ve swapped out application from using the OpenGLRenderer to use the android CanvasRenderer. This was done to get around the black background appearing for the chart while redrawing. Referenced here.

This works and at the moment we’ve yet to experience any performance issues. However every time we add data to the chart we get an exception printed into the log:

java.lang.IllegalArgumentException: width and height must be > 0
    at android.graphics.Bitmap.createBitmap(Bitmap.java:829)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:808)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:775)
    at com.scichart.drawing.canvas.CanvasTexture.<init>(CanvasTexture.java:33)
    at com.scichart.drawing.canvas.CanvasAssetManager.createCanvasTexture(CanvasAssetManager.java:106)
    at com.scichart.charting.visuals.axes.AxisTitleRendererComponent.onDraw(AxisTitleRendererComponent.java:93)
    at com.scichart.charting.visuals.axes.AxisTitleRendererComponent$VerticalAxisTitleRendererComponent.onDraw(AxisTitleRendererComponent.java:123)
    at com.scichart.charting.visuals.axes.DefaultAxisTitleRenderer.onDraw(DefaultAxisTitleRenderer.java:112)
    at com.scichart.charting.visuals.axes.AxisBase.onDraw(AxisBase.java:838)
    at com.scichart.charting.visuals.rendering.RenderSurfaceRenderer.onDrawAxes(RenderSurfaceRenderer.java:510)
    at com.scichart.charting.visuals.rendering.RenderSurfaceRenderer.onDrawAxes(RenderSurfaceRenderer.java:505)
    at com.scichart.charting.visuals.rendering.RenderSurfaceRenderer.draw(RenderSurfaceRenderer.java:378)
    at com.scichart.charting.visuals.rendering.RenderSurfaceRenderer.renderLoop(RenderSurfaceRenderer.java:150)
    at com.scichart.charting.visuals.rendering.RenderSurfaceRenderer.onDraw(RenderSurfaceRenderer.java:137)
    at com.scichart.drawing.canvas.RenderSurface.onDraw(RenderSurface.java:121)
    at android.view.View.draw(View.java:16195)
    at android.view.View.buildDrawingCacheImpl(View.java:15492)
    at android.view.View.buildDrawingCache(View.java:15353)
    at android.view.View.updateDisplayListIfDirty(View.java:15173)
    at android.view.View.draw(View.java:15965)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3612)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3402)
    at android.view.View.draw(View.java:16198)
    at android.view.View.updateDisplayListIfDirty(View.java:15192)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3596)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3576)
    at android.view.View.updateDisplayListIfDirty(View.java:15152)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3596)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3576)
    at android.view.View.updateDisplayListIfDirty(View.java:15152)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3596)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3576)
    at android.view.View.updateDisplayListIfDirty(View.java:15152)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3596)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3576)
    at android.view.View.updateDisplayListIfDirty(View.java:15152)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3596)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3576)
    at android.view.View.updateDisplayListIfDirty(View.java:15152)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3596)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3576)
    at android.view.View.updateDisplayListIfDirty(View.java:15152)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3596)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3576)
    at android.view.View.updateDisplayListIfDirty(View.java:15152)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3596)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3576)
    at android.view.View.updateDisplayListIfDirty(View.java:15152)
    at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3596)
    at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3576)
    at android.view.View.updateDisplayListIfDirty(View.java:15152)
    at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:281)
    at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:287)
    at android.view.ThreadedRenderer.draw(ThreadedRenderer.jav

The graph seems to be working fine however I’m looking to see if there is a reason for this exception that I can resolve for peace of mind and to reduce the amount of stracktraces in the log (our chart redraws at least every 5 seconds.)

Thanks,
Keith

Update:

I’ve attached the sample project as requested.

I also believe I’ve found the cause.

Line 43 of the GraphAdapter sets the yAxis title to be “”. It seems that the canvas renderer must try and draw this empty string as a label which then fails as it has dimensions of 0 x 0.

Version
2.0.0.1654
Attachments
  • Yura Khariton
    Can you provide a project which reproduce this issue? It looks like that exception occurs during axis title rendering – do you use axis title somehow in your application?
  • Andrew Burnett-Thompson
    Hi Keith, as part of our updated Support policy https://www.scichart.com/support-policy/ we need steps or code to reproduce problems and for you to be using the latest version. Can you do this? Our team is more than happy to investigate & assist once the conditions are met.
  • You must to post comments
Showing 0 results

Try SciChart Today

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

Start TrialCase Studies