0
我正在縮放時嘗試更改爲核心圖的mainIntervalScale,以便放大時軸上顯示的項更少,放大時顯示更多項。我無法使其工作任何人都可以幫忙嗎?這是迄今爲止我得到的代碼。謝謝當放大核心圖時更改majorIntervalScale
-(BOOL)plotSpace:(CPTPlotSpace *)space shouldScaleBy:(CGFloat)interactionScale aboutPoint:(CGPoint)interactionPoint
{
return YES;
}
-(CPTPlotRange *)plotSpace:(CPTPlotSpace *)space willChangePlotRangeTo:(CPTPlotRange *)newRange forCoordinate:(CPTCoordinate)coordinate
{
self.graphScaleX = self.graphScaleX*newRange.lengthDouble;
self.graphScaleY = self.graphScaleY*newRange.lengthDouble;
CPTXYAxisSet *axisSet = (CPTXYAxisSet *)self.graph.axisSet;
CPTXYAxis *x = axisSet.xAxis;
CPTXYAxis *y = axisSet.yAxis;
x.majorIntervalLength=CPTDecimalFromFloat(self.graphScaleX);
y.majorIntervalLength=CPTDecimalFromFloat(self.graphScaleY);
return newRange;
}
正是我所期待的!謝謝! – ChrisBorg