Hello,
I am using the latest version of Telerik iOS frame work. How can I show the percentage of a pie chart? Here is my code.
- (void)viewDidLoad {
[super viewDidLoad];
TKChart *chart = [[TKChart alloc] initWithFrame:CGRectInset(self.view.bounds, 15, 15)];
chart.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[self.view addSubview:chart];
NSMutableArray *pointsWithValueAndName = [[NSMutableArray alloc] init];
[pointsWithValueAndName addObject:[[TKChartDataPoint alloc] initWithName:@"Google" value:@20]];
[pointsWithValueAndName addObject:[[TKChartDataPoint alloc] initWithName:@"Apple" value:@30]];
[pointsWithValueAndName addObject:[[TKChartDataPoint alloc] initWithName:@"Microsoft" value:@20]];
[pointsWithValueAndName addObject:[[TKChartDataPoint alloc] initWithName:@"IBM" value:@20]];
[pointsWithValueAndName addObject:[[TKChartDataPoint alloc] initWithName:@"Oracle" value:@10]];
TKChartPieSeries *series = [[TKChartPieSeries alloc] initWithItems:pointsWithValueAndName];
[chart addSeries:series];
chart.legend.hidden = NO;
chart.legend.style.position = TKChartLegendPositionRight;
series.labelDisplayMode = TKChartPieSeriesLabelDisplayModeInside;
// NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
// [numberFormatter setNumberStyle:NSNumberFormatterSpellOutStyle];
// series.style.pointLabelStyle.formatter = numberFormatter;
series.style.pointLabelStyle.stringFormat = @"%.0f %%";
}
With the NSNumber formatter nothing is showing as well​.