2010-09-02 75 views

回答

3

創建方式。

在CPTBarPlotDataSource協議有一個

-(CPTFill *)barFillForBarPlot:(CPTBarPlot *)barPlot recordIndex:(NSUInteger)index; 

方法就像一個魅力。

乾杯。

0

在.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]];