2

I am using https://github.com/danielgindi/Charts enter image description here

How to hide the values which are shown on each bar. My code is as below

func setUpChartView(){
    viewGraphContent.delegate = self
    viewGraphContent.pinchZoomEnabled = false
    viewGraphContent.chartDescription?.enabled = true
    viewGraphContent.dragEnabled = false
    viewGraphContent.setScaleEnabled(false)
    viewGraphContent.highlightFullBarEnabled = true
    viewGraphContent.doubleTapToZoomEnabled = false
    viewGraphContent.drawBordersEnabled = true
    viewGraphContent.borderColor = UIColor.white
    viewGraphContent.borderLineWidth = 1
    viewGraphContent.legend.enabled = false
  }
DevB2F
  • 4,674
  • 4
  • 36
  • 60
Khadija Daruwala
  • 1,185
  • 3
  • 25
  • 54
  • 1
    That data you are pointing is of BarChartDataEntry. Can you show your code? – Sachin Vas Feb 14 '19 at 10:14
  • 1
    Possible duplicate of this: https://stackoverflow.com/questions/36193312/how-to-remove-the-value-label-above-each-bar-in-bar-chart-for-ios-charts – Magnas Feb 14 '19 at 10:19

1 Answers1

12

Add following line of code where you setup sets of chart to fix your issue:

var set = BarChartDataSet(values: yVals, label: "Data Set")        
set.drawValuesEnabled = false       // Set this property to false to hide all values

let data = BarChartData(dataSet: set)
yourChartView.data = data

This code will hide all values above bar chart. I hope this will help you.

Sagar Chauhan
  • 5,715
  • 2
  • 22
  • 56