Adding annotation to the chart area


#1

I’m not being able to the SChartAnnotation to the plot canvas when user tapps on some point.

The chart deletgate is correctly set and the following methos is invked when I tapp on the data point, but nothing is displayed.

What am I doing wrong?

- (void)sChart:(ShinobiChart *)chart toggledSelectionForPoint:(SChartDataPoint *)dataPoint inSeries:(SChartSeries *)series atPixelCoordinate:(CGPoint)pixelPoint{
    [self.chart removeAllAnnotations];
    SChartAnnotation *annotation = [SChartAnnotation annotationWithText:@"Hello World"
                                                                andFont:[UIFont boldSystemFontOfSize:12.0f]
                                                              withXAxis:self.chart.xAxis
                                                               andYAxis:self.chart.yAxis
                                                            atXPosition:[NSNumber numberWithFloat:pixelPoint.x]
                                                           andYPosition:[NSNumber numberWithFloat:pixelPoint.y]
                                                          withTextColor:[UIColor whiteColor] withBackgroundColor:[UIColor whiteColor]];
    [self.chart addAnnotation:annotation];
    [annotation updateViewWithCanvas:self.chart.canvas];
}

#2

When I wrote this post I’ve noticed that  atXPosition and  atYPosition are incorrect.

Replced with following values and everything is ok:

atXPosition:dataPoint.sChartXValue
 andYPosition:dataPoint.sChartYValue