I’m trying to add some annotations to a column chart where the x axis is a category axis and the y axis is a number axis.
The first requirement is to draw a horizontal band above each column showing a calculated difference. I’ve tried creating a horizontal band then giving it an xValue and setting strethToBoundsOnX to NO but the result is a thin line in the middle of the bar, it doesn’t stretch to the width of the bar. Is this possible? The code I’m using is
SChartAnnotationZooming *diffBarAnnotation = [SChartAnnotationZooming horizontalBandAtPosition:@(value) andMaxY:@(value * 1.1) withXAxis:chart.xAxis andYAxis:chart.yAxis withColor:[UIColor greenColor]]; diffBarAnnotation.xValue = name; diffBarAnnotation.stretchToBoundsOnX = NO;
The other requirement is to show a horizontal line above each column and I have exacly the same issue - the line either fills the width of the chart (strechToBoundsOnX = YES) or shows as a dot in the middle of the column (strechToBoundsOnX = NO)
Is there any way of making the annotations match the width of the column? Can I get the width of the column and change the frame of the annotation?