Charts: In iOS-Chart how to hide the x and y axis and all the grid lines.

Created on 4 Mar 2016  Â·  11Comments  Â·  Source: danielgindi/Charts

I did try setting
let xAxis:ChartXAxis = barChartView.xAxis xAxis.drawAxisLineEnabled = false xAxis.drawGridLinesEnabled = false
but this doesnot seems to work.

current

This is what i have right now.

I am trying to achieve
expected_end_result

Could somebody help.
Thank you in advance.

Most helpful comment

Use limit lines like so:
let limitLine = ChartLimitLine(limit: 0, label: "")
limitLine.lineColor = UIColor.blackColor().colorWithAlphaComponent(0.3)
limitLine.lineWidth = 1

barChart.rightAxis.addLimitLine(limitLine)

All 11 comments

Try set leftAxis and rightAxis

Thank you so much.
It worked :)

Is there a way i can enable gridlines at specific locations?

Use limit lines like so:
let limitLine = ChartLimitLine(limit: 0, label: "")
limitLine.lineColor = UIColor.blackColor().colorWithAlphaComponent(0.3)
limitLine.lineWidth = 1

barChart.rightAxis.addLimitLine(limitLine)

Thank you.

@LekhaP can you please share how you resolve that issue? Thanks!!!

how do I remove just the vertical lines?

@LekhaP Can you share the solution?

@LekhaP Please share how to set bar labels

Try set leftAxis and rightAxis

Can you share the solution?

@here Also can someone share solution to hide all the values and show only graph

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Shunshine07 picture Shunshine07  Â·  3Comments

kirti0525 picture kirti0525  Â·  3Comments

guoyutaog picture guoyutaog  Â·  3Comments

ahmedsafadii picture ahmedsafadii  Â·  3Comments

kwstasna picture kwstasna  Â·  3Comments