Remove Border and Margin around iOS Charts in Swift

荒凉一梦 提交于 2019-12-04 02:06:43

It is minOffset.

/** Sets the minimum offset (padding) around the chart, defaults to 10 */

You can change it as this:

chartView.minOffset = 0

that line is actually axis line.

To hide the all the lines, you can use

    totalsGraph.rightAxis.enabled = false
    totalsGraph.legend.enabled = false
    totalsGraph.leftAxis.enabled = false
    totalsGraph.xAxis.labelPosition = .bottom
    totalsGraph.xAxis.drawGridLinesEnabled = false
    totalsGraph.xAxis.drawAxisLineEnabled = false

I am looking for solution to remove margins as well. I will update my answer when I find it.

Actually the way to do it is like this:

chartView.xAxis.enabled = false
chartView.leftAxis.enabled = false
chartView.rightAxis.enabled = false
chartView.drawBordersEnabled = false
chartView.minOffset = 0
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!