【问题标题】:Points on a CorePlot graphCorePlot 图上的点
【发布时间】:2012-08-09 10:38:01
【问题描述】:

我正在使用 CorePlot 处理图形,我的应用程序中有这个图形:

The graphic I have http://data.imagup.com/10/1159174088.3134png

现在我需要将坐标标记为点,如下所示:

The graphic I want http://data.imagup.com/12/1159172987.1122png

我必须添加什么才能拥有它?

谢谢

【问题讨论】:

  • 你在设置 plotSymbol 吗?
  • [boundLinePlot setPlotSymbol:(我不知道放什么在这里)];我在网上搜索有关 CorePlot 文档的信息,但没有找到任何东西。谢谢

标签: objective-c ios ipad graphics core-plot


【解决方案1】:

你可以做这样的事情..

// Add the plot symbol.
CPTPlotSymbol *plotSymbol = [CPTPlotSymbol ellipsePlotSymbol]; // Ellipse is used for circles
plotSymbol.fill = [CPTFill fillWithColor:[CPTColor blueColor]];
plotSymbol.size = CGSizeMake(5.0, 5.0);

// Set the line style of the edges of your symbol. (Around your symbol)
CPTMutableLineStyle *plotSymbolLineStyle = [[[CPTMutableLineStyle alloc] init] autorelease];
plotSymbolLineStyle.lineColor = [CPTColor blackColor];
plotSymbolLineStyle.lineWidth = 1.0f;
plotSymbol.lineStyle = plotSymbolLineStyle;

plot.plotSymbol = plotSymbol;

plot 可以是例如 CPTScatterPlot

从这里应该很容易根据需要修改符号。

【讨论】:

  • 非常感谢,完美运行,现在我问你,CorePlot你是从哪里学来的,因为我不想,每次都来问可以的问题很容易。 ;)
  • @zak:每当有什么我不知道怎么做的时候,我通常都会查看文档,或者 Core Plot 附带的示例。如果我还没有找到任何东西,我会在 SO 和 Google 上进行一些搜索。我从研究这些例子中学到了最多的东西。
  • 你在哪里找到了那个例子或那个文档?顺便问一下,你知道如何使坐标原点固定(不动)吗?
  • @zak:文档和示例(带代码)在 Core Plot 主页上。你应该检查出来。 :-) 对于您的其他问题:看看轴约束。 (参见CPTAxis 类的axisConstraints 属性。如果您有任何与此相关的问题,您可能应该创建另一个问题,或者进行一些搜索。)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-04-15
相关资源
最近更新 更多