【问题标题】:coreplot bar tap not workingcoreplot 栏点击不工作
【发布时间】:2013-01-01 18:07:52
【问题描述】:

我已经从 Github 下载了这段代码:https://github.com/gilthonweapps/CorePlotBarChartExample。如何获取 onTap 以选择 bar ?我正在使用以下代码:

#pragma mark - CPTBarPlotDelegate methods
-(void)barPlot:(CPTBarPlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)index {

     NSLog(@"barWasSelectedAtRecordIndex %d", index);
}

但这不起作用(它无法识别水龙头)。请帮助。 提前致谢,新年快乐。

【问题讨论】:

标签: ios ios5 ios6 core-plot bar-chart


【解决方案1】:

将绘图 delegate 设置为您的条形图委托对象。这通常是视图控制器,但并非必须如此。

【讨论】:

  • 谢谢 Eric 先生,但我该怎么做呢?你能解释一下吗?这将是一个很大的帮助。现在已经尝试了 10 多天。再次感谢。
  • 我已将 CPTPlotSpaceDelegate 更改为 CPTBarPlotDelegate 并且我有一个问题 ::: 从不兼容的类型 'GraphView *' 分配给 'id'
  • 一个类可以实现多个协议。确保 CPTPlotSpaceDelegateCPTBarPlotDelegate 都列在类定义中。
猜你喜欢
  • 2015-09-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-02-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多