2011-03-31 81 views
2

在iPhone应用程序中,我使用核心Plot垂直条形图。CorePlot删除栏阴影效果

如何去除竖条中的阴影效果?

这里如图条与阴影显示

enter image description here

下面是代码:

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

barPlot.shadowColor = NO;

我该如何消除这种阴影效应?

请帮助和建议。

感谢

+0

[iPhone -Core剧情问题(http://stackoverflow.com/questions/5484019/iphone-core-plot-problem) – Macmade 2011-03-31 08:25:42

回答

5

没有测试过这一点,但我的猜测是,你看到的是不是一个影子,但通过使用“tubularBarPlotWithColor”产生渐变填充。影子可能是酒吧边界外的东西。

相反,尝试创建柱状图:

CPBarPlot *barPlot = [[CPBarPlot alloc] init]; 

然后使用:

barPlot.fill = [CPFill fillWithColor:myCPColor]; 

或者,如果你真的想要一个渐变填充:

fillGradient = [CPGradient gradientWithBeginningColor:myCPColorBegin endingColor:myCPColorEnd]; 
barPlot.fill = [CPFill fillWithGradient:fillGradient]; 

希望这有助于! 克拉斯

+0

感谢回复的可能重复。这里@ barPlot.fill = [CPFill fillWithColor:myCPColor];如果我给“绿色”比它显示绿色,但如果我采取“colorwithcomponent红色:绿色:蓝色:alpha”,它显示栏为白色,它没有采取任何值的RGB颜色 – ios 2011-03-31 10:42:12

0

我所面临的白色曲线isssue

yourPlot.fill = [CPTFill fillWithColor:[CPTColor colorWithComponentRed:80.0f/255.0f绿色:186.0f/255.0f蓝:224.0f/255.0f阿尔法: 1.0F]];

这给了我想要的颜色..