当单击 iOS 的 Shinobi 图表中的一个点时,我正在尝试创建和显示带有 X 和 Y 值的标签。
我在这里找到了答案的第一部分 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
}
我可以用这个创建文本字符串:
[NSString stringWithFormat:@"Amount:%@ from %@", dataPoint.yValue, dataPoint.xValue];
但是如何使用 Shinobi Charts 创建标签并将这个 NSString 分配给它?