Iphone 具有不同颜色条的CPBarPlot

Iphone 具有不同颜色条的CPBarPlot,iphone,core-plot,Iphone,Core Plot,有没有一种方法可以在一个绘图空间中的CPBarPlot中使用不同的颜色条 提前感谢。 在CPTBarPlotDataSource协议中有一个 -(CPTFill *)barFillForBarPlot:(CPTBarPlot *)barPlot recordIndex:(NSUInteger)index; 一种像符咒一样有效的方法 干杯。在.h文件中 @property (nonatomic, strong) CPTBarPlot *yourPlot1; @property (nonato

有没有一种方法可以在一个绘图空间中的CPBarPlot中使用不同的颜色条

提前感谢。

在CPTBarPlotDataSource协议中有一个

-(CPTFill *)barFillForBarPlot:(CPTBarPlot *)barPlot recordIndex:(NSUInteger)index;
一种像符咒一样有效的方法

干杯。

在.h文件中

 @property (nonatomic, strong) CPTBarPlot *yourPlot1;
 @property (nonatomic, strong) CPTBarPlot *yourPlot2;
在.m文件中

self.yourPlot1 = [[CPTBarPlot alloc] init];
self.yourPlot1.fill = [CPTFill fillWithColor:[CPTColor colorWithComponentRed:194.0f/255.0f   green:237.0f/255.0f blue:154.0f/255.0f alpha:1.0f]];
self.yourPlot2 = [[CPTBarPlot alloc] init];
self.yourPlot2.fill = [CPTFill fillWithColor:[CPTColor colorWithComponentRed:190.0f/255.0f green:245.0f/255.0f blue:104.0f/255.0f alpha:1.0f]];