Search code examples
ios-charts

iOS Charts: Top axis line not drawn when labels at bottom


I'm using a LineChart with the x axis labels at the bottom and I don't understand why the top x axis line isn't drawn. xAxis.drawAxisLineEnabled is set to true.

Is it possible to have the top axis line drawn without labels at the top of the chart?

Image of charts with and without top x axis line


Solution

  • As per your requirement, you need to enable Graph border by enabling the below property

    lineChartView.drawBordersEnabled = true
    

    Hope this will help to show you the top line for XAxis.

    Sample:

    enter image description here