Closed GoogleCodeExporter closed 9 years ago
The labels are being created in - (CPTLayer *)dataLabelForPlot:(CPTPlot *)plot
recordIndex:(NSUInteger)index.
static CPTMutableTextStyle *whiteText = nil;
if (!whiteText) {
whiteText = [[CPTMutableTextStyle alloc] init];
whiteText.color = [SPReportBuilder labelColor];
}
CPTTextLayer *newLayer = [[[CPTTextLayer alloc] initWithText:labelString
style:whiteText] autorelease];
Original comment by hunter.h...@gmail.com
on 3 Oct 2011 at 11:02
I'm having trouble reproducing the problem. The example apps render correctly
for me. The plot labels and axis labels both use the same positioning mechanism
to prevent blurry text, so I'm not sure why one works and the other doesn't.
Have you tried other plot types? I'm curious whether the problem is limited to
pie charts or affects other plots, too.
Original comment by eskr...@mac.com
on 4 Oct 2011 at 1:49
I'm seeing this on pie charts, scatter plots and bar charts. In every case,
everything inside the plot area (hope i have my terms right) is a bit blurry
and everything outside (axis stuff) looks normal.
I just loaded up the sample app... and it looks normal. So I guess I'm doing
something in my code then? Here's my complete source for my data label method:
- (CPTLayer *)dataLabelForPlot:(CPTPlot *)plot recordIndex:(NSUInteger)index {
static CPTMutableTextStyle *whiteText = nil;
if (!whiteText) {
whiteText = [[CPTMutableTextStyle alloc] init];
whiteText.color = [CPTColor whiteColor];
}
CPTTextLayer *newLayer = nil;
NSNumber *percentageNumber = [plot cachedNumberForField:CPTPieChartFieldSliceWidthNormalized recordIndex:index];
if ([percentageNumber floatValue] > 0) {
NSNumberFormatter *percentageFormatter = [[NSNumberFormatter alloc] init];
[percentageFormatter setNumberStyle:NSNumberFormatterPercentStyle];
NSString *formattedPercent = [percentageFormatter stringFromNumber:percentageNumber];
[percentageFormatter release];
NSString *labelString = [NSString stringWithFormat:@"On-Task - %@", formattedPercent];
newLayer = [[[CPTTextLayer alloc] initWithText:labelString style:whiteText] autorelease];
}
return newLayer;
}
Original comment by hunter.h...@gmail.com
on 5 Oct 2011 at 1:11
Any new progress on this issue?
Original comment by ejvaug...@gmail.com
on 2 Nov 2011 at 4:10
Original comment by eskr...@mac.com
on 2 Nov 2011 at 11:02
This issue was closed by revision d162df23531a.
Original comment by eskr...@mac.com
on 7 Nov 2011 at 2:43
Original issue reported on code.google.com by
hunter.h...@gmail.com
on 3 Oct 2011 at 10:58Attachments: