Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
613 views
in Technique[技术] by (71.8m points)

android - How to remove description from chart in MPAndroidChart?

I am using MPAndroidChart.

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.8k users

...