iOS-Charts how to allow clicks only on plotted points?

Viewed 1418

I'm using iOS charts framework to plot this chart, I want to detect tap or touch only on the line's path or on the small circle's on the lines.

My question is,

Is there any default code block to do this?

I tried comparing the entry.value with the array plotted(as in the following code), but it doesn't workout.

-(void)chartValueSelected:(ChartViewBase *)chartView entry:(ChartDataEntry *)entry dataSetIndex:(NSInteger)dataSetIndex highlight:(ChartHighlight *)highlight{

        if ([arrayOfPlottedValues containsObject:[NSNumber numberWithInt:(int)entry.value]]) {
            //Tapped on line path
        }
        else{
            //Tapped on empty area
        }
 }

Any insights will be appreciated.

eg : Line chart

2 Answers
Related