Note that there are some explanatory texts on larger screens.

plurals
  1. POGPL-compatible graphing library for Android
    text
    copied!<p>In a similar approach to <a href="https://stackoverflow.com/questions/424752/any-good-graphing-packages-for-android">this question</a>, I am looking for a way to plot data points on to a view in Android. Preferably, a library which will do this for arbitrary-ranged input, as well as allow panning and zooming (via pinch or zoom bar).</p> <p>Right now, I have subclass-ed a view which does the following normalization:</p> <pre><code> final int width = View.MeasureSpec.getSize(this.widthMeasureSpec); final int height = View.MeasureSpec.getSize(this.heightMeasureSpec); final float factorA = width / (maxA - minA); final float factorS = height / (maxS - minS); final float constFactorA = factorA * minA; final float constFactorS = factorS * minS; final int dataLength = data.length; for (int i = 0; i &lt; dataLength; ++i) { if (i % 2 == 0) _data[i] = _data[i] * factorA - constFactorA; else _data[i] = _data[i] * factorS - constFactorS; } </code></pre> <p>and a call in onDraw() to the drawPoints method of a canvas (also, I update this.widthMeasureSpec and this.heightMeasureSpec in onMeasure()).</p> <p>This is with minA/maxA as the bounds for my independent variable and minS/maxS as the bounds for my dependent variable.</p> <p>This works fine for displaying the data, but I am hoping someone else has solved the problem of drawing the axes and panning/zooming.</p> <p>I have ~150,000 data points, and I would prefer to keep these as floats to save half the memory. I don't know how big decimal numbers are in JavaScript, but I really don't want to resort to passing data in through JavaScript for the Google Charts API or an HTML-based solution for memory's sake.</p> <p>I'm running this on a MyTouch 3g (the original, before 3.5mm jack and it's RAM upgrade), so performance is an issue. I'd like to release the final project under the GPLv3, so this excludes <a href="http://android.arnodenhond.com/components/graphview" rel="nofollow noreferrer">GraphView</a>.</p> <p>The graphs are of the same type as <a href="https://en.wikipedia.org/wiki/File:LogisticMap_BifurcationDiagram.png" rel="nofollow noreferrer">this</a>, so any optimization by excluding points that are too close together to show up on screen would definitely make a difference.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload