Closed GoogleCodeExporter closed 9 years ago
Original comment by eskr...@mac.com
on 19 Dec 2012 at 1:42
Original comment by eskr...@mac.com
on 22 Dec 2012 at 12:13
#1: The CALayer shadow properties have never been fully supported in Core Plot.
CPTShadow exists to solve several rendering issues that came up while trying to
use the built-in shadows. Won't fix.
#2: This is a side-effect of the changes made to the border masking. Working on
a fix.
#3. The CPTPlot.shadow property affects only the plot line. Plot symbols have
their own shadows. This allows flexibility when you have multiple symbols so
you can, for example, match the shadow color to the symbol color. I did a quick
test and scatter plot shadows seem to work as intended. Please post more
details if you see additional problems with these.
#4. Fixed.
Original comment by eskr...@mac.com
on 22 Dec 2012 at 1:13
Thanks Eric. For #3: this is essentially about the plot line. However I fill
the area between the plot line and the base line. I don't use any plot symbols.
I think this should work with CPTPlot.shadow instead. You can see this here:
http://www.pasteall.org/pic/show.php?id=41951. Both scatter plots have a shadow
for the content, but I can get this only to work by using CALayer.shadow*.
Original comment by mike.lischke
on 22 Dec 2012 at 11:22
Check your link—I don't see a scatter plot in that image. I tested this by
adding shadows in the Plot Gallery app. The red line in the attached image is
the shadow.
Original comment by eskr...@mac.com
on 22 Dec 2012 at 1:47
Attachments:
Hu? You don't see the light gray plot in the dark area at the top and the dark
gray plot which covers the lower right of the image? Both have been created
with:
- (CPTScatterPlot*)createScatterPlotWithFill: (CPTFill*)fill
{
CPTScatterPlot* linePlot = [[CPTScatterPlot alloc] init];
linePlot.alignsPointsToPixels = YES;
linePlot.dataLineStyle = nil;
linePlot.interpolation = CPTScatterPlotInterpolationStepped;
linePlot.areaFill = fill;
linePlot.areaBaseValue = CPTDecimalFromInt(0);
linePlot.delegate = self;
linePlot.dataSource = self;
return linePlot;
}
When I try to set a shadow for this very plot using:
- (void)setupShadowForPlot: (CPTPlot*) plot
{
plot.shadowColor = CGColorCreateGenericGray(0, 1);
plot.shadowRadius = 3.0;
plot.shadowOffset = CGSizeMake(2, -2);
plot.shadowOpacity = 0.75;
}
then I get no shadow at all (see image).
Original comment by mike.lischke
on 22 Dec 2012 at 1:55
Attachments:
[deleted comment]
Additional note: should be clear by now that I do not use a border for the
plot. This makes me think why shadows are bound to the border instead the
entire plot...
btw, the shadow setup code I posted is wrong. I used actually:
- (void)setupShadowForPlot: (CPTPlot*) plot
{
CPTMutableShadow *shadow = [CPTMutableShadow shadow];
shadow.shadowColor = [CPTColor colorWithComponentRed: 0 green: 0 blue: 0 alpha: 0.75];
shadow.shadowBlurRadius = 3.0;
shadow.shadowOffset = CGSizeMake(2, -2);
plot.shadow = shadow;
}
Original comment by mike.lischke
on 22 Dec 2012 at 2:02
The scatter plot only draws shadows behind the data line, not the area fill.
Since you're using what appears to be a solid color fill, you can add a data
line in the same color. It won't stand out from the fill, but it will cast a
shadow.
Original comment by eskr...@mac.com
on 22 Dec 2012 at 6:05
Well, it's not a solid color but a partially transparent gradient. Adding a
border line will destroy the design and is essentially just a hack. IMO it
should be possible to get a shadow without a border (data line). What about the
bar plot? Does the same limitation exist there?
Anyway, a bug tracker is not a discussion forum...
Original comment by mike.lischke
on 23 Dec 2012 at 9:34
This issue was closed by revision 9ec0ff575197.
Original comment by eskr...@mac.com
on 27 Dec 2012 at 12:22
Original issue reported on code.google.com by
mike.lischke
on 18 Dec 2012 at 9:25