Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top