Frage

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?

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top