21

I know the method for removing the x-values but how do I remove the y-values. I basically don't want ANY text on my Pie Chart.

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

Husein Kareem
  • 516
  • 1
  • 4
  • 12

8 Answers8

45

To remove the Y-Values

Use dataset.setDrawValues(false);

To remove the X-Values

Use MyPieChart.setDrawSliceText(false);

Milad Faridnia
  • 9,113
  • 13
  • 65
  • 78
onDroid
  • 461
  • 4
  • 5
24

For Charts Version 3.2.1

Both X - Y values enabled

pieChartDataSet.drawValuesEnabled = true
pieChartView.drawEntryLabelsEnabled = true

enter image description here

To remove the Y-Values

pieChartDataSet.drawValuesEnabled = false

enter image description here

To remove the X-Values

pieChartView.drawEntryLabelsEnabled = false

enter image description here

Govind Kumawat
  • 1,562
  • 1
  • 10
  • 17
7

Never mind figured it out!

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

That at least gets it from not seeing those labels.

Also another way is setting this to false:

drawLabelsEnabled
Husein Kareem
  • 516
  • 1
  • 4
  • 12
7

To remove the labels (xVals):

pieChartView.drawSliceTextEnabled = false

To remove the values (yVals):

pieChartDataSet.drawValuesEnabled = false
Morgan
  • 1,280
  • 1
  • 14
  • 15
3

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

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

Wingzero
  • 9,644
  • 10
  • 39
  • 80
3

In ios-charts version 3.1.1, you can hide piechart slice labels by setting pie_chart.drawEntryLabelsEnabled = NO;

Khushabu
  • 101
  • 6
2

Mp Android chart, please use this

To remove x-Values use pieChart.setDrawSliceText(false).

To remove y-Values use pieChart.getData().setDrawValues(false).

Energy
  • 940
  • 13
  • 20
1

In ios-charts 2.1.3, dataset.drawValuesEnabled = NO; to hide Y-Values.

DawnSong
  • 4,752
  • 2
  • 38
  • 38