【问题标题】:CPTScatterPlot not showingCPTScatterPlot 未显示
【发布时间】:2012-02-23 14:20:17
【问题描述】:

我正在使用 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];

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

【问题讨论】:

  • 不要在图表中多次添加同一个图。

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


【解决方案1】:

删除这一行:

dataSourceLinePlot.opacity = 0.0f;

【讨论】:

  • 你的建议是对的,但我的主要问题是我没有正确输入 x-y 轴范围...
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-08-22
  • 2011-06-08
  • 1970-01-01
  • 1970-01-01
  • 2017-02-19
  • 2019-04-11
相关资源
最近更新 更多