在andorid中创建圆弧图/进度条,例如arc [英] Creating Pie chart / progressbar like arc in andorid

查看:101
本文介绍了在andorid中创建圆弧图/进度条,例如arc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在一个项目中,我想显示一个饼状图(如添加的图像).已经在stackoverflow中搜索了Google和其他帖子,但是找不到解决方案.任何解决方案都值得赞赏.

注意:也欢迎第三方库的建议.另外,请不要建议MPAndroidChart,因为我认为可以使用更简单的方法来实现我的查询.

解决方案

您可以使用库

I am working on a project where I want to show a pie chart like the image added. Already have searched google and other posts in stackoverflow, but could not find a solution. any solution is appreciated.

Note: suggestions of third-party library are also welcome. Also please do not suggest MPAndroidChart as I think my query can be implemented using simpler method.

解决方案

You can use the library https://github.com/PhilJay/MPAndroidChart to achieve this.

Add below in xml:

 <com.github.mikephil.charting.charts.PieChart
    android:id="@+id/chart"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

In java code:

PieChart chart = (Piechart) findViewById(R.id.chart);

Example code:

https://github.com/PhilJay/MPAndroidChart/blob/master/MPChartExample/src/com/xxmassdeveloper/mpchartexample/PieChartActivity.java

There are lot of variances available.

Another library to consider is:

https://github.com/lecho/hellocharts-android

这篇关于在andorid中创建圆弧图/进度条,例如arc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆