I have implemented the following function to plot different symbols in scatter plot using Core Plot.

-(CPTPlotSymbol *)symbolForScatterPlot:(CPTScatterPlot *)plot recordIndex:(NSUInteger)index

But the function is not being called. I have included the delegate also. I have also implemented

CPTScatterPlot *sc_plot [[CPTScatterPlot alloc] init]; 
sc_plot.dataSource = self;

Can anyone help me out in this. What is the error in my implementation?

有帮助吗?

解决方案

Make sure the datasource only implements one of the plot symbol methods. If it implements both -symbolsForScatterPlot:recordIndexRange: and -symbolForScatterPlot:recordIndex:, only the first method will be called.

Look at the plot symbol test in the Mac CPTTestApp example app for working sample code.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top