我只是浏览了一个小时的课程,找不到它!我开始搜索AAPLot项目的例子。在哪里设置背景颜色?
我改变了一下图表,并期待在CPTTradingRangePlot类中找到所有设置,但它不在那里。
有很多属性,我可以改变,但我找不到任何类的背景设置。
有人可以给我一个提示吗?
// 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];
最好也是最简单的方法就是像Chris Hodges那样做,尽管这样做确实有效。 – Reimius