CorePlot 0.9: alternatives to isFloatingAxis property

折月煮酒 提交于 2019-12-11 04:46:50

问题


https://github.com/djw/core-plot/tree/9282845bddbb8c40ff314bbfa158beff797c91f7/examples

This states that the isFloatingAxis property has been removed from at least version 0.9.

Does anyone know how to float the x axis without this property? In other words, if I want the origin of the graph to be (0,6000) lets say, how can I maintain the x axis inside the plot range, while the y axis is NOT set to:

y.orthogonalCoordinateDecimal = CPTDecimalFromInt(0);


回答1:


I was able to figure this out by looking in the CPTTestApp example from the CorePlot_0.9 folder. I looked in the class files and found this in Controller.m:

x.axisConstraints = [CPTConstraints constraintWithUpperOffset:132];

For now, this is holding my x axis in the same spot so I can change the orthogonalCoordinateDecimal to 6000 or whatever without the x axis and labels disappearing.




回答2:


This code should help you. It sets the x-axis to range from 0-6000, and makes visible only that part on plot:

    axisSet.xAxis.visibleRange =[CPTPlotRange plotRangeWithLocation:CPTDecimalFromInt(0) length:CPTDecimalFromInt(6000)];
    axisSet.xAxis.gridLinesRange = axisSet.xAxis.visibleRange;


来源:https://stackoverflow.com/questions/8734508/coreplot-0-9-alternatives-to-isfloatingaxis-property

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!