如何从MPAndroidChart的图表中删除描述? [英] How to remove description from chart in MPAndroidChart?

查看:81
本文介绍了如何从MPAndroidChart的图表中删除描述?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 MPAndroidChart .

如何从PieChart中删除说明? 我可以用chart.setDrawLegend(false)删除Legend,但是在文档中找不到关于图表说明的任何内容.

How can I remove the description from PieChart? I can remove the Legend with chart.setDrawLegend(false), but I couldn't find anything regarding the chart description in the documentation.

推荐答案

您是说说明,它位于Chart右下角(默认)吗?

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);

或者您是在谈论传奇(在外部显示所有DataSet标签和颜色的图表)?

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

chart.getLegend().setEnabled(false);

此答案基于版本v3.0.0 + ,有关更多信息,请查看 文档 .

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

这篇关于如何从MPAndroidChart的图表中删除描述?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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