Remove all fragment text from the pie chart (ios-charts / mpandroidchart)

I know a method to remove x values, but how to remove y values. I don’t want ANY text on my pie chart at all.

The image shows the current state with labels 80.0 and 20.0 on top of the pie chart. pie chart

+9
mpandroidchart ios-charts
source share
7 answers

Ignore it!

pieChartView.data?.setValueTextColor(UIColor.clearColor()) 

This, at least, allows you not to see these tags.

Also another way sets the value to false:

 drawLabelsEnabled 
+5
source share

To remove Y values

Use dataset.setDrawValues(false);

To remove X values

Use MyPieChart.setDrawSliceText(false);

+30
source share

To remove tags (xVals):

 pieChartView.drawSliceTextEnabled = false 

To remove values ​​(yVals):

 pieChartDataSet.drawValuesEnabled = false 
+7
source share

drawLabelsEnabled will not draw any label on your chart. This is for both xAxis and yAxis

for all major configurations: https://github.com/danielgindi/ios-charts/blob/master/Charts/Classes/Components/ChartAxisBase.swift

+2
source share

In ios diagrams 2.1.3, dataset.drawValuesEnabled = NO; to hide the Y values.

+2
source share

In ios diagrams version 3.1.1, you can hide the labels of fragments of a pie chart by setting pie_chart.drawEntryLabelsEnabled = NO;

+2
source share

For charts version 3.2.1

To remove Y values

 pieChartDataSet.drawValuesEnabled = false 

To remove X values

 pieChartView.drawEntryLabelsEnabled = false 
0
source share

All Articles