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

deepumukundan picture deepumukundan  路  3Comments

newbiebie picture newbiebie  路  3Comments

kwstasna picture kwstasna  路  3Comments

PrashantKT picture PrashantKT  路  3Comments

Aungbandlab picture Aungbandlab  路  4Comments