[Android] Crash when pinch zooming


#1

So for this graph, there can be anywhere from 1 to 20-30000 data points (usually only showing around 12 on screen at a time). When pinch zooming, if you zoom out too far, the app crashes. I don’t get any stacktrace, so I’m assuming it’s happening in the native stack somewhere.

I see this line a LOT before the crash:

07-27 14:22:52.972  20551-20551/? E/Adreno-GSL﹕ <gsl_memory_alloc_pure:2042>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed.

Then, I see this last one after:

07-27 14:22:52.982  20551-20551/? A/libc﹕ Fatal signal 7 (SIGBUS) at 0x3f09f000 (code=2), thread 20551 (.app.packagename.removed)

I figured enabling large heap would help this, and while I can zoom out a bit more, it’s still very slow, and ends up crashing the app. The particular data set I was looking at had a little over 8000 data points in it. Device doesn’t seem to make a difference, I tried on 3 different devices from different manufacturers (samsung, htc, lg).


#2

Hello ryanbis,

shinobicharts is capable of handling 30,000 data points, so in this case I do not believe the issue is with the quantity of data.

When you say ‘zoom out too far’, what exactly do you mean? 

We do not set any limits on how far someone can zoom out of a chart, but we do provide the means to allow limits to be set. We recommend that you consider setting limits on zooming in or out of your chart.

Alternatively, if you do believe there may be a possible bug in our code, we would politely ask you to send us a cut down version of your application, to demonstrate the problem. Please send this to info@shinobicontrols.com and we will certainly investigate it.

Thanks,

Kai.


#3

Hello Kai,

 Thanks for replying. 

As far as zooming out too far, I just mean that if you keep zooming out, it will eventually hang up, and crash. I tried to find how to limit the zoom, but was unable to find it. How is this achieved? (this is the solution I wanted to implement, but for now just shut off zooming all together, which can be a pain with a large data set).

Thanks again!

Ryan


#4

Kai,

How do you set the limit for zoom? I have the default range set, but it’s zooming beyond that. I believe the issue is the tickfrequency. It’s much better if I set the tickfrequency to be much wider (100 vs 1). However, this isn’t what the client expects (there should be a tick for each data point). Any suggestions?

Thanks again,

Ryan


#5

Hello Ryan

There are a couple of ways in which you can limit zooming out. Firstly, you can disallow panning beyond the max range of a given Axis. With this method it is important to understand what is meant by the max range. The max range is defined as the union of the axis’ data range and its default range. Providing that you are not using your default range for some other purpose (like for example initially showing a smaller sub set of data) this should work for you.

An alternative approach is to listen for range changes on an axis and take action. In this case you would obtain the range and if it falls outside of limits (which you would decide, based on your use cases) you request that the axis displays the previous range. This will effectively stop further zooming out.

For both approaches you can find details in our api docs, which can be found here:

https://www.shinobicontrols.com/docs/ShinobiControls/ShinobiChartsAndroid/1.7.2/Premium/Normal/apidocs/docs/reference/com/shinobicontrols/charts/Axis.html

https://www.shinobicontrols.com/docs/ShinobiControls/ShinobiChartsAndroid/1.7.2/Premium/Normal/apidocs/docs/reference/com/shinobicontrols/charts/ShinobiChart.OnAxisRangeChangeListener.html

I hope that this helps,

Thanks,

Kai.