core plot (ver 0.4) legendTitleForPieChart method not being called
I'm trying 开发者_JAVA技巧to get the titles to display on the legend of a pie chart using core plot 0.4, the chart works but the legend titles don't display. The method legendTitleForPieChart does not seem to be called even though I've put an NSLog into it.
other methods like sliceWasSelectedAtRecordIndex work.
the .h has the "CPTPieChartDataSource, CPTPlotDataSource" protocols listed so it should try and call the legendTitleForPieChart method in the .m.
the .m has the piePlot.dataSource and piePlot.delegate set to self.
Is there anything else I need to do to make sure the method is called?
thanks p.s. happy to attach any code should that help.
The method is called -legendTitleForPieChart:recordIndex:
. See my answer to this question.
Make sure that your legend is init., and Set to Graph is performed after the pieChart is.
精彩评论