I am trying to create and show labels with the X and Y values when a point in a Shinobi chart for iOS is clicked.
I have found the first part of the answer here ShinobiCharts:How can show the X value and Y value when u click the point of the chart
- (void)sChart:(ShinobiChart *)chart toggledSelectionForSeries:(SChartSeries *)series nearPoint:(SChartDataPoint *)dataPoint atPixelCoordinate:(CGPoint)pixelPoint{
NSLog(@"x value:%@",dataPoint.xValue);
NSLog(@"y value:%@",dataPoint.yValue);
//here you can create an label to show the x/y values or even can add an annotation
}
I can create the text string with this:
[NSString stringWithFormat:@"Amount:%@ from %@", dataPoint.yValue, dataPoint.xValue];
But how to create the label and assign this NSString to it using Shinobi Charts?