CPBarPlot mit verschiedenen Farbbalken
Frage
Es ist eine Weise, unterschiedliche Farbbalken in einem CPBarPlot hat in nur ein Grundstück Raum?
Vielen Dank im Voraus.
Lösung
gegründet, wie.
In CPTBarPlotDataSource Protokoll gibt es ein
-(CPTFill *)barFillForBarPlot:(CPTBarPlot *)barPlot recordIndex:(NSUInteger)index;
Verfahren, das funktioniert wie ein Charme.
Prost.
Andere Tipps
In .h-Datei
@property (nonatomic, strong) CPTBarPlot *yourPlot1;
@property (nonatomic, strong) CPTBarPlot *yourPlot2;
In .m-Datei
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]];
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow