3

In my app I'm using the iOS-Charts framework, and I figured out how to remove the grid (vertical and horizontal) by using:

barChartView.leftAxis.drawGridLinesEnabled = false 
barChartView.rightAxis.drawGridLinesEnabled = false 

However, I still want to have left side Y axis and bottom X axis.

Any kind of help is highly appreciated.

DevB2F
  • 4,674
  • 4
  • 36
  • 60
Eugene Gordin
  • 4,047
  • 3
  • 47
  • 80

2 Answers2

-1

Tried every solution available for none worked for me. Seems like from Swift 4 you can not disable grid lines totally. One solution you have though is making the grid lines clear color so that they are not visible.

chartView.xAxis.gridColor = .clear
chartView.leftAxis.gridColor = .clear
chartView.rightAxis.gridColor = .clear
Anuran Barman
  • 1,556
  • 2
  • 16
  • 31
-2

To Enable x and y axis alone

 yourView.leftAxis.drawZeroLineEnabled = true

yourView.rightAxis.drawZeroLineEnabled=true
pragadeesh
  • 97
  • 1
  • 5