【问题标题】:Creating Pie chart / progressbar like arc in andorid在android中创建饼图/进度条,如弧形
【发布时间】:2016-01-16 07:35:43
【问题描述】:

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

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

【问题讨论】:

    标签: android progress-bar pie-chart android-progressbar


    【解决方案1】:

    您可以使用库https://github.com/PhilJay/MPAndroidChart 来实现这一点。

    在xml下面添加:

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

    在java代码中:

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

    示例代码:

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

    有很多可用的差异。

    另一个需要考虑的库是:

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

    【讨论】:

    • 已经看过了,我觉得这对我的工作来说太过分了@Psypher
    • 我已经包含了另一个更简单的库
    【解决方案2】:

    你也可以使用这个库 - https://github.com/lzyzsd/CircleProgress

    我发现与 MPChart 等更复杂的图表库相比,它更易于使用和自定义。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-09-09
      • 2016-04-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多