gujjula / core-plot

Automatically exported from code.google.com/p/core-plot
0 stars 0 forks source link

Setting plotSpace.globalYRange=plotSpace.yRange causes y axis to draw wrongly. #261

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Still new to objective-c, so im not sure its actually a bug. Using core plot 
2.2.

What steps will reproduce the problem?
The graph looks correct. I change some plot data and reload using the 
reloadData call, then i rescale y-axis using: 

Works:
    plotSpace.yRange = [CPPlotRange plotRangeWithLocation:CPDecimalFromFloat(min*(1-coeff))
                                                   length:CPDecimalFromFloat(max*(1+coeff)-min*(1-coeff))];

    plotSpace.globalYRange = [CPPlotRange plotRangeWithLocation:CPDecimalFromFloat(min*(1-coeff))
                                                         length:CPDecimalFromFloat(max*(1+coeff)-min*(1-coeff))];

Fails:
    plotSpace.yRange = [CPPlotRange plotRangeWithLocation:CPDecimalFromFloat(min*(1-coeff))
                                                   length:CPDecimalFromFloat(max*(1+coeff)-min*(1-coeff))];

    plotSpace.globalYRange = plotSpace.yRange;

What is the expected output? What do you see instead?
Expected: Correct rescale of y axis, but the result is axises / graph is way 
out of the plot area.

Original issue reported on code.google.com by clausr...@gmail.com on 28 Feb 2011 at 10:30

GoogleCodeExporter commented 9 years ago
Using core plot 0.2.2.

Original comment by clausr...@gmail.com on 28 Feb 2011 at 10:31

GoogleCodeExporter commented 9 years ago
Are you resetting the ranges on an existing graph? If so, remember that the 
previous globalYRange will constrain the new setting. Try setting the 
globalYRange to nil before setting a new yRange.

Original comment by eskr...@mac.com on 1 Mar 2011 at 2:16

GoogleCodeExporter commented 9 years ago
Thanks for the help. Setting them to nil first, fixed my problems and some 
other issues i was having reloading data.

Original comment by clausr...@gmail.com on 1 Mar 2011 at 6:38

GoogleCodeExporter commented 9 years ago

Original comment by eskr...@mac.com on 1 Mar 2011 at 8:01