【发布时间】:2011-11-20 20:36:28
【问题描述】:
我正在尝试在我的 iOS 应用程序中使用 Core Plot 中的散点图。我按照 Core Plot wiki 的说明设置了 Core Plot,然后将 PlotItem.h/m、PlotGallery.h/m 和 SimpleScatterPlot.h/m 从包含的 Plot Gallery 项目复制到我的项目中。代码
CPTTheme *theme = [CPTTheme themeNamed:kCPTDarkGradientTheme];
SimpleScatterPlot *scatterPlot = [[SimpleScatterPlot alloc]init];
[scatterPlot generateData];
[scatterPlot renderInLayer:hostView withTheme:theme];
运行,图形视图显示在我的应用程序中。但是我不能像在 Plot Gallery 项目中那样移动图形视图或点击绘图点。如何正确设置?
【问题讨论】:
-
hostView 是一个 CPTGraphHostingView,它在我的 viewController.h 中声明,并且在 Interface Builder 中有一个连接到 CPTGraphHostingView 的 IBOutlet。
标签: objective-c cocoa-touch graph core-plot scatter-plot