gujjula / core-plot

Automatically exported from code.google.com/p/core-plot
0 stars 0 forks source link

Since Upgrading From 0.4 to 0.9, Text Labels Inside the Plot Area Are Slightly Blurry #339

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Create pie chart with labels based on the 0.4 source code.
2. Upgrade to 0.9.
3. Display the chart.

What is the expected output? What do you see instead?

The chart looks exactly the same except the data point labels are slightly 
blurry. The other CPT rendered text such as titles and axis labels are not 
blurry.

What version of the product are you using? On what operating system?

This occurs on both iOS 4.3.5 and iOS 5.0b7.

Please provide any additional information below.

I've attached a screenshot where you can see the slight blurriness for the data 
point labels.

Original issue reported on code.google.com by hunter.h...@gmail.com on 3 Oct 2011 at 10:58

Attachments:

GoogleCodeExporter commented 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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
Any new progress on this issue?

Original comment by ejvaug...@gmail.com on 2 Nov 2011 at 4:10

GoogleCodeExporter commented 9 years ago

Original comment by eskr...@mac.com on 2 Nov 2011 at 11:02

GoogleCodeExporter commented 9 years ago
This issue was closed by revision d162df23531a.

Original comment by eskr...@mac.com on 7 Nov 2011 at 2:43