Khadija Daruwala
Khadija Daruwala

Reputation: 1205

iOS Charts remove values on the bar of the bar chart

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
  }

Upvotes: 2

Views: 2660

Answers (1)

Sagar Chauhan
Sagar Chauhan

Reputation: 5823

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.

Upvotes: 12

Related Questions