【问题标题】:CorePlot Remove bar shadow effectCorePlot 去除条形阴影效果
【发布时间】:2011-03-31 05:47:49
【问题描述】:

在 iPhone 应用程序中,我使用核心 Plot 垂直条形图。

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

如图所示,这里的条带阴影显示

代码如下:

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

barPlot.shadowColor=NO;

如何去除这种阴影效果?

请帮助和建议。

谢谢

【问题讨论】:

标签: iphone objective-c cocoa-touch ios4 core-plot


【解决方案1】:

没有对此进行测试,但我猜你看到的不是阴影,而是使用“tubularBarPlotWithColor”生成的渐变填充。阴影可能是酒吧边界之外的东西。

请尝试使用以下方法创建条形图:

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

然后使用:

barPlot.fill = [CPFill fillWithColor:myCPColor];

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

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

希望这会有所帮助! 克拉斯

【讨论】:

  • 感谢您的回复。这里@ barPlot.fill = [CPFill fillWithColor:myCPColor];如果我给出“greencolor”而不是显示绿色,但如果我采用“colorwithcomponentRed: green: blue: alpha”并且它显示白色条形,则它不采用任何 RGB 颜色值
【解决方案2】:

我遇到了白色情节问题

yourPlot.fill = [CPTFill fillWithColor:[CPTColor colorWithComponentRed:80.0f / 255.0f green:186.0f / 255.0f blue:224.0f / 255.0f alpha:1.0f]];

这给了我想要的颜色..

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-25
    • 2020-07-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多