Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to remove top grid line for line chart #4343

Closed
josmanperez opened this issue Apr 18, 2020 · 2 comments
Closed

How to remove top grid line for line chart #4343

josmanperez opened this issue Apr 18, 2020 · 2 comments

Comments

@josmanperez
Copy link

josmanperez commented Apr 18, 2020

Hi!, I just cant find the option to remove the top grid line from the linechart.

I want to remove this line here:

Screenshot 2020-04-18 at 22 10 30

I've done this, but this just remove the right and left grid but not the one on top:

        chartView.leftAxis.drawGridLinesEnabled = false
        chartView.leftAxis.drawLabelsEnabled = false
        chartView.leftAxis.drawGridLinesBehindDataEnabled = false
        chartView.leftAxis.gridColor = .clear
        chartView.leftAxis.axisLineColor = .clear
        chartView.rightAxis.drawGridLinesEnabled = false
        chartView.xAxis.drawGridLinesEnabled = false
        chartView.xAxis.drawGridLinesBehindDataEnabled = false
        chartView.rightAxis.drawLabelsEnabled = false
        chartView.rightAxis.drawGridLinesBehindDataEnabled = false
        chartView.rightAxis.gridColor = .clear
        chartView.rightAxis.axisLineColor = .clear

Thank you

@josmanperez
Copy link
Author

Hello, I'm answering my own question.

This two lines made the trick:

        chartView.xAxis.drawAxisLineEnabled = false
        chartView.xAxis.labelTextColor = .clear

Thank you!

@navasiloy
Copy link

navasiloy commented Aug 13, 2020

@josmanperez
instead of
chartView.xAxis.labelTextColor = .clear

better to use
chartView.xAxis.drawLabelsEnabled = false

To remove the grid it's enough to use this:

chartView.leftAxis.drawGridLinesEnabled = false
chartView.rightAxis.drawGridLinesEnabled = false
chartView.xAxis.drawGridLinesEnabled = false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants