Il existe un moyen d'avoir différentes barres de couleur dans un CPBarPlot dans un seul espace de tracé?CPBarPlot avec différentes barres de couleur
Merci d'avance.
Il existe un moyen d'avoir différentes barres de couleur dans un CPBarPlot dans un seul espace de tracé?CPBarPlot avec différentes barres de couleur
Merci d'avance.
Fondé comment.
Dans protocole CPTBarPlotDataSource il existe une méthode
-(CPTFill *)barFillForBarPlot:(CPTBarPlot *)barPlot recordIndex:(NSUInteger)index;
qui fonctionne comme un charme.
Cheers.
Dans le fichier .h
@property (nonatomic, strong) CPTBarPlot *yourPlot1;
@property (nonatomic, strong) CPTBarPlot *yourPlot2;
Dans le fichier .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]];