Je venais de parcourir les cours pendant une heure et je ne peux pas le trouver! J'ai commencé par chercher l'exemple du projet AAPLot.où définir la couleur de fond?
J'ai légèrement modifié le graphique et je m'attendais à trouver tous les paramètres dans la classe CPTTradingRangePlot mais ce n'est pas le cas.
Il y a beaucoup de propriétés que je peux changer, mais je ne peux pas trouver les paramètres d'arrière-plan dans l'une des classes.
Quelqu'un pourrait-il me donner un indice?
// OHLC plot
CPTMutableLineStyle *whiteLineStyle = [CPTMutableLineStyle lineStyle];
whiteLineStyle.lineColor = [CPTColor whiteColor];
whiteLineStyle.lineWidth = 1.0f;
CPTTradingRangePlot *ohlcPlot = [[[CPTTradingRangePlot alloc] initWithFrame:graph.bounds] autorelease];
ohlcPlot.identifier = @"OHLC";
ohlcPlot.lineStyle = whiteLineStyle;
ohlcPlot.barWidth = 4.0f;
ohlcPlot.increaseFill = [(CPTFill *)[CPTFill alloc] initWithColor:[CPTColor greenColor]];
ohlcPlot.decreaseFill = [(CPTFill *)[CPTFill alloc] initWithColor:[CPTColor redColor]];
CPTMutableTextStyle *whiteTextStyle = [CPTMutableTextStyle textStyle];
whiteTextStyle.color = [CPTColor whiteColor];
whiteTextStyle.fontSize = 12.0;
ohlcPlot.labelTextStyle = whiteTextStyle;
ohlcPlot.labelOffset = 5.0;
ohlcPlot.stickLength = 2.0f;
ohlcPlot.dataSource = self;
ohlcPlot.plotStyle = CPTTradingRangePlotStyleCandleStick;
[graph addPlot:ohlcPlot];
Le meilleur et le plus simple est de le faire comme l'exemple de Chris Hodges, même si cela fonctionne. – Reimius