質問

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