Different color for y-axis grid line at zero value on chart


I have a simple line chart that has value in both positive and negative regions.

How do I set a different color for my y-axis grid line at zero value.

Screenshot: http://take.ms/zUiSz



It sounds like an annotation (specifically a horizontal line annotation) should accomplish what you’re after - you may find our ‘Adding Annotations’ sample of some help to you.


SChartAnnotation *baselineAnnotation = [SChartAnnotation horizontalLineAtPosition:@0 withXAxis:_chart.xAxis andYAxis:_chart.yAxis withWidth:1 withColor:[UIColor purpleColor]];

baselineAnnotation.position = SChartAnnotationBelowData;
[_chart addAnnotation:baselineAnnotation];