Reputation: 33
In my application I'm using iOS Charts and I want to split my line chart to sectors by vertical grid line with different color than have others (someting like on chart below). I looked into documentation but I didn't find any solution how to do that. I know only how to change color of all grid lines at once. Thanks for any advice.
UPDATE:
Here is my solution. I have array with x positions for vertical lines and in for loop I will add limit lines to chart.
for k:Int in 0 ..< limitLines.count {
let limitLine = ChartLimitLine()
limitLine.lineColor = UIColor.red
limitLine.limit = limitLines[k]
limitLine.lineWidth = 0.8
lineChartView.xAxis.addLimitLine(limitLine)
}
Here is resulting chart.
Upvotes: 2
Views: 2816
Reputation: 9754
well.. this is not officially supported, but you could override drawGridLine()
on x axis to do so, just need to know which grid line needs another color.
Upvotes: 1