Touching a multiple plotsymbol in core plot and get the two touch plot symbol index

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 03:00:30

问题


I want to get the difference between two points touched simultaneously. But i am only getting one index into scatter plot by this method,

-(void)scatterPlot:(CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)idx withEvent:(CPTNativeEvent *)event;

How to get two index by multitouch?


回答1:


The built-in interaction methods only support one point at a time. You can get the coordinates of the touch points, convert them to the coordinate space of the plot area layer, and use the -indexOfVisiblePointClosestToPlotAreaPoint: method to get the index of each point from the scatter plot.



来源:https://stackoverflow.com/questions/25135829/touching-a-multiple-plotsymbol-in-core-plot-and-get-the-two-touch-plot-symbol-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!