2011-03-31 66 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]];

這給了我想要的顏色..