我有一个气泡图achartengine
。我有一个XYMultipleSeriesRenderer
,我添加了一个XYValueSeries
并绘制了几个点。我有 X 和 Y 轴的自定义标签。问题是当我们将所有点一起显示时标签太小了。所以我所做的就是设置setXAxisMax(10)
,setYAxisMax(10)
以便在轴上一次显示 10 个点。但是,如果您平移和移动应用程序崩溃,但以下情况除外:
09-20 09:56:11.427: E/AndroidRuntime(3041): java.lang.ArrayIndexOutOfBoundsException: length=202; index=-51
09-20 09:56:11.427: E/AndroidRuntime(3041): at java.util.ArrayList.get(ArrayList.java:310)
09-20 09:56:11.427: E/AndroidRuntime(3041): at org.achartengine.model.XYValueSeries.getValue(XYValueSeries.java:118)
09-20 09:56:11.427: E/AndroidRuntime(3041): at org.achartengine.chart.BubbleChart.drawSeries(BubbleChart.java:78)
09-20 09:56:11.427: E/AndroidRuntime(3041): at org.achartengine.chart.XYChart.drawSeries(XYChart.java:540)
09-20 09:56:11.427: E/AndroidRuntime(3041): at org.achartengine.chart.XYChart.draw(XYChart.java:320)
09-20 09:56:11.427: E/AndroidRuntime(3041): at org.achartengine.GraphicalView.onDraw(GraphicalView.java:181)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.view.View.draw(View.java:13944)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.view.View.draw(View.java:13825)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.view.ViewGroup.drawChild(ViewGroup.java:3083)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2920)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.view.View.draw(View.java:13823)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.view.ViewGroup.drawChild(ViewGroup.java:3083)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2920)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.view.View.draw(View.java:13823)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.view.ViewGroup.drawChild(ViewGroup.java:3083)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2920)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.view.View.draw(View.java:13823)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.view.ViewGroup.drawChild(ViewGroup.java:3083)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2920)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.view.View.draw(View.java:13823)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.view.ViewGroup.drawChild(ViewGroup.java:3083)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2920)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.view.View.draw(View.java:13947)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.widget.FrameLayout.draw(FrameLayout.java:467)
09-20 09:56:11.427: E/AndroidRuntime(3041): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2224)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2482)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2395)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2239)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1872)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1004)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5481)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.view.Choreographer.doCallbacks(Choreographer.java:562)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.view.Choreographer.doFrame(Choreographer.java:532)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.os.Handler.handleCallback(Handler.java:730)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.os.Handler.dispatchMessage(Handler.java:92)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.os.Looper.loop(Looper.java:137)
09-20 09:56:11.427: E/AndroidRuntime(3041): at android.app.ActivityThread.main(ActivityThread.java:5103)
09-20 09:56:11.427: E/AndroidRuntime(3041): at java.lang.reflect.Method.invokeNative(Native Method)
09-20 09:56:11.427: E/AndroidRuntime(3041): at java.lang.reflect.Method.invoke(Method.java:525)
09-20 09:56:11.427: E/AndroidRuntime(3041): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
09-20 09:56:11.427: E/AndroidRuntime(3041): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
09-20 09:56:11.427: E/AndroidRuntime(3041): at dalvik.system.NativeStart.main(Native Method)
请让我知道可能是什么问题