Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone CorePlot:缩放后如何获得正确的值?缩放后如何获得正确的比例编号? 缩放后如何获得正确的值 缩放后如何获得正确的比例编号 如何将Yaxis放置在另一侧,如下图所示_Iphone_Charts_Zooming_Core Plot - Fatal编程技术网

Iphone CorePlot:缩放后如何获得正确的值?缩放后如何获得正确的比例编号? 缩放后如何获得正确的值 缩放后如何获得正确的比例编号 如何将Yaxis放置在另一侧,如下图所示

Iphone CorePlot:缩放后如何获得正确的值?缩放后如何获得正确的比例编号? 缩放后如何获得正确的值 缩放后如何获得正确的比例编号 如何将Yaxis放置在另一侧,如下图所示,iphone,charts,zooming,core-plot,Iphone,Charts,Zooming,Core Plot,我现在遇到的问题是,如果触摸图表,我可以得到正确的Y值,然后你可以得到正确的Y值,但是如果我放大,值将变为错误 我试着用这个函数来得到刻度 -(BOOL)plotSpace:(CPTPlotSpace*)space shouldScaleBy:(CGFloat)interactionScale aboutPoint:(CGPoint)interactionPoint 但我得到的刻度数字不正确 请大家帮忙 这是正确的屏幕截图: 这是错误的 -(BOOL)plotSpace:(CPTPlotSp

我现在遇到的问题是,如果触摸图表,我可以得到正确的Y值,然后你可以得到正确的Y值,但是如果我放大,值将变为错误

我试着用这个函数来得到刻度

-(BOOL)plotSpace:(CPTPlotSpace*)space shouldScaleBy:(CGFloat)interactionScale aboutPoint:(CGPoint)interactionPoint
但我得到的刻度数字不正确

请大家帮忙

这是正确的屏幕截图:

这是错误的

-(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 & drag on the plot space.

- (BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceDraggedEvent:(id)event atPoint:(CGPoint)point
{        
    if( ((self.view.frame.size.height- point.y+20)<324)
       &&((self.view.frame.size.height- point.y+20)>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;
}

-(BOOL)绘图空间:(CPTPlotSpace*)空间应按:(CGFloat)交互缩放关于点:(CGPoint)交互点
{
n小数点[2];
CPTXYPlotSpace*xySpace=(CPTXYPlotSpace*)空间;
[xySpace plotPoint:PlotArea视点的plotPoint:interactionPoint];
NSLog(@“Dragg事件规模:%f”,真实规模值);
NSString*显示内容\u测试=[NSString stringWithFormat:@“缩放Y值$:%f”,
([[NSDecimalNumber decimalNumberWithDecimal:plotPoint[CPT坐标]]doubleValue]);
返回YES;
}
//当用户触摸并拖动绘图空间时调用此方法。
-(BOOL)plotSpace:(CPTPlotSpace*)空间应与指针设备draggedevent:(id)事件点:(CGPoint)点
{        
如果(((self.view.frame.size.height-point.y+20)22))
{
n小数点[2];
CPTXYPlotSpace*xySpace=(CPTXYPlotSpace*)空间;
[xySpace plotPoint:PLOTAPOINT FOR PLOTAREA VIEW:point];
NSLog(@“Dragg事件规模:%f”,真实规模值);
showingcontent=[NSString stringWithFormat:@“价格$:%f”,
([[NSDecimalNumber decimalNumberWithDecimal:plotPoint[CPT坐标]]doubleValue])*实标数值-13.42623-5.573770-0.163934];
当前价格显示文本=显示内容;
[self.view带来subviewstofront:当前的价格/展会];
CGRect separator\u line\u frame=separator\u line.frame;
separator\u line\u frame.origin.y=self.view.frame.size.height-point.y+20;
//最终目的地
分隔符线框=分隔符线框;
[self.view将子视图带到前面:分隔线];
}
返回YES;
}

在不同绘图比例下转换值时遇到的问题是舍入问题。以像素为单位获得接触点。在任何绘图范围内只有有限数量的像素。如果放大,将增加任意两个给定值之间的像素数

要向右移动y轴,请减少右侧填充,并确保宿主视图填充屏幕宽度