
Untitled
By: a guest on
Jul 31st, 2012 | syntax:
None | size: 0.85 KB | hits: 14 | expires: Never
coreplot:Converted coordinates, have problems. [plotSpace plotPoint:plotPoint forPlotAreaViewPoint:point];
-(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceDownEvent:(id)event atPoint:(CGPoint)point
{ NSDecimal plotPoint[2];
CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)graph.defaultPlotSpace;
[plotSpace plotPoint:plotPoint forPlotAreaViewPoint:point];
//HERE HAVE SOME OFFSET. I FIND ,it Calculated part of the x-axis from the border
NSLog(@"touch plotPoint = %d, %f",
[[NSDecimalNumber decimalNumberWithDecimal:plotPoint[CPTCoordinateX]] intValue],
[[NSDecimalNumber decimalNumberWithDecimal:plotPoint[CPTCoordinateY]] doubleValue]);
return YES;
}
CGPoint plotAreaPoint = [graph convertPoint:point toLayer:graph.plotAreaFrame.plotArea];
[plotSpace plotPoint:plotPoint forPlotAreaViewPoint:plotAreaPoint];