How to remove description from chart in MPAndroidChart?

前端 未结 4 1861
夕颜
夕颜 2020-12-15 02:40

I am using MPAndroidChart.

How can I remove the description from PieChart? I can remove the Legend with chart.setDrawLegend(false)

相关标签:
4条回答
  • 2020-12-15 03:03

    in kotlin use

    chart.description.isEnabled = false
    
    0 讨论(0)
  • 2020-12-15 03:11

    In the new version you can do it like this:

    Description des = Chart.getDescription();
    des.setEnabled(false);
    

    If you want to remove the legend:

    Legend leg = Chart.getLegend();
    leg.setEnabled(false);
    
    0 讨论(0)
  • 2020-12-15 03:21

    you can remove it by simply passing null into it.

    pieChart.setDescription(null);

    0 讨论(0)
  • 2020-12-15 03:25

    Do you mean the description which is in the bottom right corner (default) of the Chart?

    If so, simply call:

    chart.getDescription().setEnabled(false);

    Or did you mean the textual description inside the pie-slices?

    pieChart.setDrawSliceText(false);

    Or did you mean the actual slice values inside the pie-slices?

    pieData.setDrawValues(false);

    Or are you talking about the Legend (shows all DataSet labels and colors outside of the chart)?

    chart.getLegend().setEnabled(false);

    This answer is based on release v3.0.0+, for more information check out the documentation.

    0 讨论(0)
提交回复
热议问题