Repository: PhilJay/MPAndroidChart

Issue #2962: Crash on RealTime graph
Created: 2017-03-28T09:07:56Z
Hi phil
First of all amazing Job!!
I am experiencing a crash working with the Latest Version V3.0.2 (It also happened on older versions)
it happen after 2 minuets of adding Entries.
I am working with a BLE watch that sends events in High rate - around 8 each second. once I reduce it to once every 800 milliseconds the crash is no longer happening.
Thanks!
Crash Log:
java.lang.IndexOutOfBoundsException: Index: 0, Size: 1
at java.util.ArrayList.get(ArrayList.java:411)
at com.github.mikephil.charting.renderer.LegendRenderer.renderLegend(LegendRenderer.java:377)
at com.github.mikephil.charting.charts.BarLineChartBase.onDraw(BarLineChartBase.java:266)
at android.view.View.draw(View.java:18313)
at android.view.View.updateDisplayListIfDirty(View.java:17291)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3950)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3930)
at android.view.View.updateDisplayListIfDirty(View.java:17254)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3950)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3930)
at android.view.View.updateDisplayListIfDirty(View.java:17254)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3950)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3930)
at android.view.View.updateDisplayListIfDirty(View.java:17254)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3950)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3930)
at android.view.View.updateDisplayListIfDirty(View.java:17254)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3950)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3930)
at android.view.View.updateDisplayListIfDirty(View.java:17254)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3950)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3930)
at android.view.View.updateDisplayListIfDirty(View.java:17254)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3950)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3930)
at android.view.View.updateDisplayListIfDirty(View.java:17254)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:666)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:672)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:780)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:3093)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2889)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2483)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1490)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7027)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:927)
at android.view.Choreographer.doCallbacks(Choreographer.java:702)
at android.view.Choreographer.doFrame(Choreographer.java:638)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:913)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6688)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)

Duplicate issue #2992: (LineChart)IndexOutOfBoundsException
Created: 2017-04-06T06:04:06Z
Version:3.0.2
When I draw realtime entry, it often crash like below, it seems like that something wrong at LegendRenderer.java:377

FATAL EXCEPTION: main
Process: xxx, PID: 9130
java.lang.IndexOutOfBoundsException: Index: 0, Size: 1
at java.util.ArrayList.get(ArrayList.java:411)
at com.github.mikephil.charting.renderer.LegendRenderer.renderLegend(LegendRenderer.java:377)
at com.github.mikephil.charting.charts.BarLineChartBase.onDraw(BarLineChartBase.java:266)
at android.view.View.draw(View.java:17189)
at android.view.View.updateDisplayListIfDirty(View.java:16171)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3711)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3691)
at android.view.View.updateDisplayListIfDirty(View.java:16134)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3711)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3691)
at android.view.View.updateDisplayListIfDirty(View.java:16134)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3711)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3691)
at android.view.View.updateDisplayListIfDirty(View.java:16134)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3711)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3691)
at android.view.View.updateDisplayListIfDirty(View.java:16134)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3711)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3691)
at android.view.View.updateDisplayListIfDirty(View.java:16134)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3711)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3691)
at android.view.View.updateDisplayListIfDirty(View.java:16134)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:648)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:654)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:762)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2800)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2608)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2215)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1254)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6343)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:874)
at android.view.Choreographer.doCallbacks(Choreographer.java:686)
at android.view.Choreographer.doFrame(Choreographer.java:621)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:860)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6126)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

Closing comment (2017-07-06T06:15:23Z): This is a duplicate of #2962