CPTScatterPlot未显示

时间:2012-02-23 14:20:18

标签: ipad ios-simulator core-plot scatter-plot

我正在使用CPTScatterPlot在iPad中显示图表。代码运行正常但图中没有绘制点。甚至没有显示单点。为什么会这样?

我的代码是:

CPTScatterPlot *dataSourceLinePlot = [[[CPTScatterPlot alloc] init] autorelease];
dataSourceLinePlot.identifier = @"Red Plot";

CPTMutableLineStyle *symbolLineStyle2 = [CPTLineStyle lineStyle];
symbolLineStyle2.lineColor = [CPTColor redColor];
symbolLineStyle2.lineWidth = 5.0;
//symbolLineStyle2.miterLimit = 1.0f;
dataSourceLinePlot.dataLineStyle = symbolLineStyle2;
dataSourceLinePlot.dataSource = self;
[graph addPlot:dataSourceLinePlot];


// Animate in the new plot, as an example
dataSourceLinePlot.opacity = 0.0f;
[graph addPlot:dataSourceLinePlot];

我检查了两个委托方法。两者都返回正确的值,但图表没有绘制可能的原因。请帮忙......

1 个答案:

答案 0 :(得分:1)

删除此行:

dataSourceLinePlot.opacity = 0.0f;