1

I am trying to hide all of the lines that iOS-Charts displays. However there is one line that I cannot hide. I have searched through the docs but could not find an answer.

                let data = LineChartData()
                let ds = LineChartDataSet(entries: yValues, label: "Day")
                ds.setColor(#colorLiteral(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0))
                ds.setCircleColor(.white)
                ds.circleRadius = 5
                ds.lineWidth = 3
                ds.valueFont = UIFont.systemFont(ofSize: 6, weight: .bold)

                ds.valueColors = [#colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)]
                data.addDataSet(ds)
                cell.averageTempChartView.data = data

            }else{
                cell.averageTempLabel.text = ""
            }

            cell.cellView.layer.cornerRadius = 30
            cell.cellView.translatesAutoresizingMaskIntoConstraints = false
            cell.cellView.layer.shadowOpacity = 0.23
            cell.cellView.layer.shadowRadius = 3
            cell.cellView.layer.shadowOffset = CGSize(width: 0, height: 0)
            cell.cellView.layer.shadowColor = UIColor.black.cgColor
            cell.cellView.backgroundColor = #colorLiteral(red: 1, green: 0.7843137255, blue: 0.2039215686, alpha: 1)

            cell.averageTempChartView.xAxis.wordWrapEnabled = true
            cell.averageTempChartView.xAxis.labelPosition = XAxis.LabelPosition.bottom
            cell.averageTempChartView.xAxis.labelTextColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)
            cell.averageTempChartView.xAxis.labelFont = UIFont.systemFont(ofSize: 12, weight: .bold)
            cell.averageTempChartView.rightAxis.enabled = false
            cell.averageTempChartView.xAxis.granularity = 1
            cell.averageTempChartView.xAxis.drawAxisLineEnabled = false
            cell.averageTempChartView.xAxis.drawGridLinesEnabled = false
            cell.averageTempChartView.leftAxis.gridColor = .clear
            cell.averageTempChartView.rightAxis.gridColor = .clear

            cell.averageTempChartView.leftAxis.drawLabelsEnabled = false
            cell.averageTempChartView.rightAxis.drawLabelsEnabled = false
            cell.averageTempChartView.noDataText = ""
            cell.averageTempChartView.legend.enabled = false
            cell.averageTempChartView.noDataFont = UIFont.systemFont(ofSize: 15, weight: .bold)
            cell.averageTempChartView.noDataTextColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)

enter image description here Any help is appreciated

1
  • 1
    I think you need cell.averageTempChartView.leftAxis.enabled = false Commented Jan 8, 2020 at 20:01

1 Answer 1

2

You already used the right property drawAxisLineEnabled for xAxis, so just use the same property for leftAxis.

cell.averageTempChartView.leftAxis.drawAxisLineEnabled = false

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.