我想在Android中的条形图尝试一些代码,但我得到以下错误。 Android中的条形图可以有任何不同的代码吗?

时间:2011-05-16 05:15:08

标签: android bar-chart

我想在Android中使用条形图。我尝试了一些代码,但是我收到以下错误。任何人都可以为android中的条形图提供不同的代码吗?

05-16 10:34:53.572: ERROR/AndroidRuntime(465): Uncaught handler: thread main exiting due to uncaught exception
05-16 10:34:53.595: ERROR/AndroidRuntime(465): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.android.drawline/com.android.drawline.SalesBarChart}: java.lang.ClassCastException: com.android.drawline.SalesBarChart
05-16 10:34:53.595: ERROR/AndroidRuntime(465): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)
05-16 10:34:53.595: ERROR/AndroidRuntime(465): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
05-16 10:34:53.595: ERROR/AndroidRuntime(465): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
05-16 10:34:53.595: ERROR/AndroidRuntime(465): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
05-16 10:34:53.595: ERROR/AndroidRuntime(465): at android.os.Handler.dispatchMessage(Handler.java:99)
05-16 10:34:53.595: ERROR/AndroidRuntime(465): at android.os.Looper.loop(Looper.java:123)
05-16 10:34:53.595: ERROR/AndroidRuntime(465): at android.app.ActivityThread.main(ActivityThread.java:4363)
05-16 10:34:53.595: ERROR/AndroidRuntime(465): at java.lang.reflect.Method.invokeNative(Native Method)
05-16 10:34:53.595: ERROR/AndroidRuntime(465): at java.lang.reflect.Method.invoke(Method.java:521)
05-16 10:34:53.595: ERROR/AndroidRuntime(465): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
05-16 10:34:53.595: ERROR/AndroidRuntime(465): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
05-16 10:34:53.595: ERROR/AndroidRuntime(465): at dalvik.system.NativeStart.main(Native Method)
**05-16 10:34:53.595: ERROR/AndroidRuntime(465): **Caused by: java.lang.ClassCastException**: com.android.drawline.SalesBarChart**
05-16 10:34:53.595: ERROR/AndroidRuntime(465): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
05-16 10:34:53.595: ERROR/AndroidRuntime(465): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409)
05-16 10:34:53.595: ERROR/AndroidRuntime(465): ... 11 more

2 个答案:

答案 0 :(得分:2)

对Android中的所有类型的图表使用achartEngine。快速简单的集成。

答案 1 :(得分:0)

尝试achartengine这是一个免费的图形库....它包含所有图形这将起作用