How can I change the color of the scatter plot of the main area?

I made a scatter plot and am trying to change the color of the drawn dots. Here is an analogue of what I'm trying to do with CPT

// Add line style
CPTMutableLineStyle *lineStyle = [CPTMutableLineStyle lineStyle];
lineStyle.lineWidth = 1.0f;
lineStyle.lineColor = [CPTColor greenColor];
dataSourceLinePlot.dataLineStyle = lineStyle;

How to do this using a CPTX scatter plot?

+3
source share
2 answers

Set a property plotSymbolto draw a character at each data point. The CPTTestApp Mac version has a demo version that displays all predefined forms. If necessary, you can create your own character forms.

Implement one of the following data source methods if you need to draw different characters for some data points:

-(NSArray *)symbolsForScatterPlot:(CPTScatterPlot *)plot
                 recordIndexRange:(NSRange)indexRange;
-(CPTPlotSymbol *)symbolForScatterPlot:(CPTScatterPlot *)plot
                           recordIndex:(NSUInteger)index;
+2
source

CPTScatterPlot . , CPTPlotSymbol, , , , , lineStyle.

+1

All Articles