divyavamsee / core-plot

Automatically exported from code.google.com/p/core-plot
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Incorrect drawing of bar plot base line #489

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
With a bar plot having a border the part at the base is drawn incorrectly 
sometimes, depending on the vertical plot range as the screenshots below show.

I see the problem for many different plot ranges, one example is {-3500, 
18500}, even though it might also depend on the overall size of the plot.

Original issue reported on code.google.com by mike.lischke on 29 Dec 2012 at 6:04

Attachments:

GoogleCodeExporter commented 9 years ago
Yes, I can confirm it also depends on the overall size of the graph/plot. In 
fact most of the time the drawing is ok, but at certain sizes the line is 
doubled.

Original comment by mike.lischke on 29 Dec 2012 at 6:07

GoogleCodeExporter commented 9 years ago
What is the setting of alignsPointsToPixels when you see the problem? Is this a 
Mac or iOS app?

Original comment by eskr...@mac.com on 29 Dec 2012 at 8:34

GoogleCodeExporter commented 9 years ago
Oh, sorry, I should have mentioned this. It's an OSX application, running on a 
MBP Retina, OSX 10.8. The setup is:

- (CPTBarPlot*)createBarPlotWithFill: (CPTFill*)fill withBorder: 
(BOOL)withBorder
{
    CPTBarPlot *barPlot = [[CPTBarPlot alloc] init];
    barPlot.barBasesVary = NO;
    barPlot.barWidthsAreInViewCoordinates = YES;
    barPlot.barWidth = CPTDecimalFromFloat(barWidth);
    barPlot.barCornerRadius = 3.0f;
    barPlot.barsAreHorizontal = NO;
    barPlot.baseValue = CPTDecimalFromInt(0);
    barPlot.alignsPointsToPixels = YES;

    if (withBorder) {
        CPTMutableLineStyle* lineStyle = [[CPTMutableLineStyle alloc] init];
        lineStyle.lineColor = [CPTColor whiteColor];
        lineStyle.lineWidth = 1;
        barPlot.lineStyle = lineStyle;
    } else {
        barPlot.lineStyle = nil;
    }
    barPlot.fill = fill;

    barPlot.delegate = self;
    barPlot.dataSource = self;

    return barPlot;
}

Original comment by mike.lischke on 29 Dec 2012 at 8:45

GoogleCodeExporter commented 9 years ago
Did the fix for issue #485 also fix this problem?

Original comment by eskr...@mac.com on 30 Dec 2012 at 12:42

GoogleCodeExporter commented 9 years ago
Hmm, I did not get a mail notificiation for your message...

The issue is still there for both, retina and non-retina displays. On retina 
displays however it's hardly noticable because a single line is very small. On 
non-retina displays the effect is well visible. The thing is, people won't 
usually resize the application window that often (which in my case resizes the 
plot) but it can (and did) happen that the plot had by accident the height that 
the doubling was visible and it looked ugly. Nobody would come to the idea to 
resize the window to get rid of that.

Original comment by mike.lischke on 1 Feb 2013 at 8:02

GoogleCodeExporter commented 9 years ago

Original comment by eskr...@mac.com on 1 Feb 2013 at 1:03

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

Original comment by eskr...@mac.com on 10 Mar 2013 at 11:35