VinsonGuo / android-kline

Android版K线图和分时图
Apache License 2.0
629 stars 120 forks source link

当数据量过少时会出现崩溃问题 #4

Closed a1265137718 closed 6 years ago

a1265137718 commented 6 years ago

Process: com.guoziwei.kline, PID: 12886 java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255) at java.util.ArrayList.get(ArrayList.java:308) at com.github.mikephil.charting.data.DataSet.getEntryForIndex(DataSet.java:286) at com.github.mikephil.charting.utils.Transformer.generateTransformedValuesLine(Transformer.java:184) at com.guoziwei.klinelib.chart.LineChartRenderer.drawValues(LineChartRenderer.java:551) at com.guoziwei.klinelib.chart.AppCombinedChartRenderer.drawValues(AppCombinedChartRenderer.java:96) at com.github.mikephil.charting.charts.BarLineChartBase.onDraw(BarLineChartBase.java:263) at android.view.View.draw(View.java:14465) at android.view.View.getDisplayList(View.java:13362) at android.view.View.getDisplayList(View.java:13404) at android.view.View.draw(View.java:14182) at android.view.ViewGroup.drawChild(ViewGroup.java:3103) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940) at android.view.View.getDisplayList(View.java:13357) at android.view.View.getDisplayList(View.java:13404) at android.view.View.draw(View.java:14182) at android.view.ViewGroup.drawChild(ViewGroup.java:3103) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940) at android.view.View.getDisplayList(View.java:13357) at android.view.View.getDisplayList(View.java:13404) at android.view.View.draw(View.java:14182) at android.view.ViewGroup.drawChild(ViewGroup.java:3103) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940) at android.view.View.getDisplayList(View.java:13357) at android.view.View.getDisplayList(View.java:13404) at android.view.View.draw(View.java:14182) at android.view.ViewGroup.drawChild(ViewGroup.java:3103) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940) at android.view.View.getDisplayList(View.java:13357) at android.view.View.getDisplayList(View.java:13404) at android.view.View.draw(View.java:14182) at android.view.ViewGroup.drawChild(ViewGroup.java:3103) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940) at android.view.View.draw(View.java:14468) at android.support.v4.view.ViewPager.draw(ViewPager.java:2418) at android.view.View.getDisplayList(View.java:13362) at android.view.View.getDisplayList(View.java:13404) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3077) at android.view.View.getDisplayList(View.java:13300) at android.view.View.getDisplayList(View.java:13404) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3077) at android.view.View.getDisplayList(View.java:13300) at android.view.View.getDisplayList(View.java:13404) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3077) at android.view.View.getDisplayList(View.java:13300) at android.view.View.getDisplayList(View.java:13404) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3077) at android.view.View.getDisplayList(View.java:13300) at android.view.View.getDisplayList(View.java:13404) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3077) at android.view.View.getDisplayList(View.java:13300) at android.view.View.getDisplayList(View.java:13404) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3077) at android.view.View.getDisplayList(View.java:13300) at android.view.View.getDisplayList(View.java:13404) at android.view.HardwareRenderer$GlRenderer.buildDisplayList(HardwareRenderer.java:1570) at android.view.HardwareRenderer$GlRenderer.draw(HardwareRenderer.java:1449) at android.view.ViewRootImpl.draw(ViewRootImpl.java:2405) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2277) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1907) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1024) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5694) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761) at android.view.Choreographer.doCallbacks(Choreographer.java:574) at and

a1265137718 commented 6 years ago

问题出现的K线图 其他图标暂不清楚

TJHello commented 6 years ago

怎么解决,是数量的问题还是数据不对的问题?

VinsonGuo commented 6 years ago

1.0.2版本已修复,原因可参考https://github.com/PhilJay/MPAndroidChart/issues/2455

a1265137718 commented 6 years ago

老哥 ,稳