title: CorePlot: How to Get a Correct Value After Zoom? How to Get A Correct Scale Number After Zoom?
body: <ol>
  <li>How to Get a Correct Value After Zoom? </li>
  <li>How to Get A Correct Scale Number After Zoom?</li>
  <li>How to put Yaxis another side like the following photo</li>
  </ol>
  
  <p><img src="https://i.stack.imgur.com/gXhG5.png" alt="enter image description here"></p>
  
  <p>The problem I am having now is I can get correct Y value if touch the Chart, then you can get a correct Y Value, but if i zoom in, the value will become wrong!</p>
  
  <p>I try to use this function to get the scale</p>
  
  <pre><code>-(BOOL)plotSpace:(CPTPlotSpace*)space shouldScaleBy:(CGFloat)interactionScale aboutPoint:(CGPoint)interactionPoint
  </code></pre>
  
  <p>But the scale number i get is not correct </p>
  
  <p>Everyone please help!!!</p>
  
  <p>This is the correct Screen Capture:</p>
  
  <p><img src="https://i.stack.imgur.com/9heRy.png" alt="enter image description here"></p>
  
  <p>and this is the wrong one</p>
  
  <p><img src="https://i.stack.imgur.com/bSPmi.png" alt="enter image description here"></p>
  
  <pre><code>-(BOOL)plotSpace:(CPTPlotSpace*)space shouldScaleBy:(CGFloat)interactionScale aboutPoint:(CGPoint)interactionPoint
  {
      NSDecimal plotPoint[2]; 
      CPTXYPlotSpace *xySpace = (CPTXYPlotSpace *)space; 
      [xySpace plotPoint:plotPoint forPlotAreaViewPoint:interactionPoint]; 
      NSLog(@"Dragg Event Scale:  %f",real_scaleValue);
      NSString *showingcontent_testing=[NSString stringWithFormat:@"Scale Y VAlue $:%f", 
                                        ([[NSDecimalNumber decimalNumberWithDecimal:plotPoint[CPTCoordinateY]] doubleValue])];
  
      return YES;
  }
  
  
  // This method is call when user touch &amp; drag on the plot space.
  
  - (BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceDraggedEvent:(id)event atPoint:(CGPoint)point
  {        
      if( ((self.view.frame.size.height- point.y+20)&lt;324)
         &amp;&amp;((self.view.frame.size.height- point.y+20)&gt;22))
      {
  
          NSDecimal plotPoint[2]; 
  
          CPTXYPlotSpace *xySpace = (CPTXYPlotSpace *)space; 
  
          [xySpace plotPoint:plotPoint forPlotAreaViewPoint:point]; 
  
          NSLog(@"Dragg Event Scale:  %f",real_scaleValue);
  
          showingcontent=[NSString stringWithFormat:@"Price $:%f", 
                          (([[NSDecimalNumber decimalNumberWithDecimal:plotPoint[CPTCoordinateY]] doubleValue])*real_scaleValue)-13.42623-5.573770-0.163934];
  
          current_price_show.text=showingcontent;
  
          [self.view bringSubviewToFront:current_price_show];
  
          CGRect separator_line_frame = separator_line.frame;
  
          separator_line_frame.origin.y =self.view.frame.size.height- point.y+20; 
  
          // final y destination
  
          separator_line.frame = separator_line_frame;
  
          [self.view bringSubviewToFront:separator_line];
  
      }
      return YES;
  }
  </code></pre>