Reputation: 526
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.
Upvotes: 22
Views: 19661
Reputation: 21
For MPAndroidChart use the following as one of the recommendations above is deprecated:
pieData.setDrawValues(false);
pieChart.setDrawEntryLabels(false);
Upvotes: 0
Reputation: 958
Mp Android chart, please use this
To remove x-Values use pieChart.setDrawSliceText(false).
To remove y-Values use pieChart.getData().setDrawValues(false).
Upvotes: 2
Reputation: 1592
For Charts Version 3.2.1
Both X - Y values enabled
pieChartDataSet.drawValuesEnabled = true
pieChartView.drawEntryLabelsEnabled = true
To remove the Y-Values
pieChartDataSet.drawValuesEnabled = false
To remove the X-Values
pieChartView.drawEntryLabelsEnabled = false
Upvotes: 26
Reputation: 471
To remove the Y-Values
Use dataset.setDrawValues(false);
To remove the X-Values
Use MyPieChart.setDrawSliceText(false);
Upvotes: 46
Reputation: 101
In ios-charts version 3.1.1, you can hide piechart slice labels by setting pie_chart.drawEntryLabelsEnabled = NO;
Upvotes: 3
Reputation: 1310
To remove the labels (xVals):
pieChartView.drawSliceTextEnabled = false
To remove the values (yVals):
pieChartDataSet.drawValuesEnabled = false
Upvotes: 7
Reputation: 5162
In ios-charts 2.1.3, dataset.drawValuesEnabled = NO;
to hide Y-Values.
Upvotes: 1
Reputation: 526
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
Upvotes: 7
Reputation: 9754
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
Upvotes: 3