CorePlot删除条形阴影效果

ios*_*ios 2 iphone cocoa-touch objective-c core-plot ios4

在iPhone App我使用的是核心Plot垂直条形图.

如何删除垂直条中的阴影效果?

这里如图所示,条形图显示阴影

在此输入图像描述

这是代码:

CPBarPlot*barPlot = [CPBarPlot tubularBarPlotWithColor:[CPColor colorWithComponentRed:111 green:129 blue:113 alpha:1.0] horizo​​ntalBars:NO];

barPlot.shadowColor = NO;

如何删除此阴影效果?

请帮助和建议.

谢谢

小智 5

没有测试过这个,但我的猜测是你看到的不是阴影,而是使用" tubularBarPlotWithColor" 生成的渐变填充.阴影可能是酒吧边界之外的东西.

相反,尝试使用以下方法创建条形图:

CPBarPlot *barPlot = [[CPBarPlot alloc] init];
Run Code Online (Sandbox Code Playgroud)

然后使用:

barPlot.fill = [CPFill fillWithColor:myCPColor];
Run Code Online (Sandbox Code Playgroud)

或者,如果您确实想要渐变填充:

fillGradient = [CPGradient gradientWithBeginningColor:myCPColorBegin endingColor:myCPColorEnd]; 
barPlot.fill = [CPFill fillWithGradient:fillGradient];  
Run Code Online (Sandbox Code Playgroud)

希望这可以帮助!克拉斯