0
我試圖讓我的控制線靜態的,所以,而不是被顯示爲圖形(控制線與曲線的移動)的一部分靜線,它們將顯示像軸如何創建coreplot
應用程序只能水平滾動
我說的是兩個紅線和綠線(我把在x軸)
這是我做我的臺詞:
// Center line
CPTScatterPlot *centerLinePlot = [[CPTScatterPlot alloc] init];
centerLinePlot.identifier = kCenterLine;
CPTMutableLineStyle *lineStyle = [CPTMutableLineStyle lineStyle];
lineStyle.lineWidth = 2.0;
lineStyle.lineColor = [CPTColor greenColor];
centerLinePlot.dataLineStyle = lineStyle;
centerLinePlot.dataSource = self;
[graph addPlot:centerLinePlot];
,但也許它是與所顯示的範圍:
////////ajuste la portion a voir
if(data.Resultats.count>10)
{
plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(data.Resultats.count - 10) length:CPTDecimalFromDouble(10)];
}
plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(RangeMin) length:CPTDecimalFromDouble(RangeMax-RangeMin)];
// Adjust visible ranges so plot symbols along the edges are not clipped
CPTMutablePlotRange *xRange = [plotSpace.xRange mutableCopy];
CPTMutablePlotRange *yRange = [plotSpace.yRange mutableCopy];
//place l'axe x sur la ligne de controle pour voir les WorkOrders
x.orthogonalCoordinateDecimal = CPTDecimalFromDouble(center);
//x.orthogonalCoordinateDecimal = yRange.location;
//y.orthogonalCoordinateDecimal = xRange.location;
//x.visibleRange = xRange;
//y.visibleRange = yRange;
//x.gridLinesRange = yRange;
//y.gridLinesRange = xRange;
[xRange expandRangeByFactor:CPTDecimalFromDouble(1.15)];//1.05
[yRange expandRangeByFactor:CPTDecimalFromDouble(1.15)];
plotSpace.xRange = xRange;
plotSpace.yRange = yRange;
謝謝你,因爲沒有滾動限制我會嘗試第二個選項。我會在幾分鐘後發佈結果 – 2012-04-03 14:25:16
我試過 CPTXYPlotSpace * ControlPlotSpace = [[CPTXYPlotSpace alloc] init]; [圖addPlotSpace:ControlPlotSpace]; and changed [graph addPlot:centerLinePlot]; 至 [graph addPlot:centerLinePlot toPlotSpace:ControlPlotSpace]; 但控制圖剛剛消失 – 2012-04-03 17:24:53
您是否在新的繪圖空間上設置了繪圖範圍? – 2012-04-04 01:30:07