Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 31st, 2012  |  syntax: None  |  size: 0.85 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. coreplot:Converted coordinates, have problems. [plotSpace plotPoint:plotPoint forPlotAreaViewPoint:point];
  2. -(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceDownEvent:(id)event atPoint:(CGPoint)point
  3. {    NSDecimal plotPoint[2];
  4.     CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)graph.defaultPlotSpace;
  5.     [plotSpace plotPoint:plotPoint forPlotAreaViewPoint:point];
  6.  
  7.  
  8.    //HERE HAVE SOME OFFSET. I FIND ,it Calculated part of the x-axis from the border
  9.     NSLog(@"touch plotPoint = %d, %f",
  10.     [[NSDecimalNumber decimalNumberWithDecimal:plotPoint[CPTCoordinateX]] intValue],
  11.     [[NSDecimalNumber decimalNumberWithDecimal:plotPoint[CPTCoordinateY]] doubleValue]);
  12.     return YES;
  13. }
  14.        
  15. CGPoint plotAreaPoint = [graph convertPoint:point toLayer:graph.plotAreaFrame.plotArea];
  16. [plotSpace plotPoint:plotPoint forPlotAreaViewPoint:plotAreaPoint];