【问题标题】:core plot (ver 0.4) legendTitleForPieChart method not being called核心图(0.4 版)legendTitleForPieChart 方法未被调用
【发布时间】:2011-09-01 12:05:51
【问题描述】:

我正在尝试使用 core plot 0.4 让标题显示在饼图的图例上,图表有效,但图例标题不显示。即使我已将 NSLog 放入其中,似乎也没有调用方法 legendTitleForPieChart。

像 sliceWasSelectedAtRecordIndex 这样的其他方法也可以工作。

.h 列出了“CPTPieChartDataSource、CPTPlotDataSource”协议,因此它应该尝试调用 .m 中的 legendTitleForPieChart 方法。

.m 将 piePlot.dataSource 和 piePlot.delegate 设置为 self。

我还需要做些什么来确保调用该方法吗?

谢谢 p.s.如果有帮助,很乐意附上任何代码。

【问题讨论】:

    标签: ios4 core-plot


    【解决方案1】:

    该方法称为-legendTitleForPieChart:recordIndex:。请参阅我对this question 的回复。

    【讨论】:

    • 感谢埃里克的回复。该方法没有被调用?任何想法我如何强迫它被调用?再次感谢!
    • 再次检查拼写并确保它已在您的数据源对象中定义。
    【解决方案2】:

    确保您的图例是 init.,并在 pieChart 之后执行 Set to Graph。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-07-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-04
      • 1970-01-01
      相关资源
      最近更新 更多