2012-04-11 15 views
1

ich mehrere x-Achse hinzufügen möchten, Mein Code ist wie folgt:Fügen Sie zusätzliche x-Achsen in Kern-Plot

CPTXYAxisSet *axisSet = (CPTXYAxisSet *)barChart.axisSet; 

    /// Here I customize default x and y axis. And they are correctly visible 

    // Now create additional x axis 
CPTXYAxis *bottomX = [[CPTXYAxis alloc]init]; 
bottomX.orthogonalCoordinateDecimal = CPTDecimalFromString(@"4"); 

CPTMutableLineStyle * lineStyle  = [CPTMutableLineStyle lineStyle]; 
lineStyle.lineWidth    = 3.0f; 
lineStyle.lineColor    = [CPTColor greenColor]; 
lineStyle.dashPattern   = [NSArray arrayWithObjects:[NSNumber numberWithFloat:5.0f], [NSNumber numberWithFloat:5.0f], nil]; 

bottomX.axisLineStyle = lineStyle; 

NSMutableArray * axes=[NSMutableArray arrayWithArray:axisSet.axes]; 
[axes addObject:bottomX]; 

axisSet.axes=axes; 

Die Standard-x, y-Achsen sind perfekt, aber die zusätzliche x-Achse (BottomX) zeigt nirgends wo.

Antwort

4

benötigen Sie den Plot Platz auf der neuen Achse einzustellen:

bottomX.plotSpace = barChart.defaultPlotSpace; 
+0

Wo Sie Mann versteckt wurden ........ –

+0

Dank viel BTW –

Verwandte Themen