Search code examples
iosgraphcore-plotincrementclickable

ios core plot increase CPTPlotSymbol clickable area


I am using core plot library for showing Scatter plot in my app. I am creating CPTPlotSymbol like this :-

CPTMutableLineStyle *symbolLineStyle = [CPTMutableLineStyle lineStyle];
symbolLineStyle.lineColor = [CPTColor blackColor];
CPTPlotSymbol *plotSymbol = [CPTPlotSymbol ellipsePlotSymbol];
plotSymbol.fill          = [CPTFill fillWithColor:blueColor];
plotSymbol.lineStyle     = symbolLineStyle;
plotSymbol.size          = CGSizeMake(5.0 , 5.0);

Then graph point are looking like this.

enter image description here

I am trying to click these points on iphone device but I am not able to click them easily.

I want to keep points size as it is now and want to increase the clickable area only. Is it possible with core plot library?


Solution

  • Use the plotSymbolMarginForHitDetection property on the scatter plot. This increases the size of the tappable zone around each plot symbol.