ios Core Plot - symbolforScatterPlot not being called

547 views Asked by At

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?

1

There are 1 answers

6
Eric Skroch On BEST ANSWER

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.