Second xAxis on a chart captions wrong!


#1

Hi!, i’ve been testing the Shinobi API and I found a problem adding a second xAxis in a example  the chart, I need to print another label below the original on the X Axis, so I did this:

SChartCategoryAxis *xAxis = [SChartCategoryAxisnew];

 

xAxis.title = @"X-Axis";

 

miChart.xAxis = xAxis;

 





 









 





 

// Use a number axis for the y axis.

 

SChartNumberAxis *yAxis = [[SChartNumberAxisalloc] init];

 

yAxis.title = @"Y-Axis";

 

miChart.yAxis = yAxis;

 





 









 









 





 

// Use a number axis for the x axis. EXTRA

 

SChartCategoryAxis *xAxis2 = [SChartCategoryAxisnew];

 

xAxis2.title = @"X-Axis-2";

 

[miChartaddXAxis:xAxis2];



 
Then I set 2 series:
  • (int)numberOfSeriesInSChart:(ShinobiChart *)chart {

    return 2;

}

  • (int)sChart:(ShinobiChart *)chart numberOfDataPointsForSeriesAtIndex:(int)seriesIndex {

    return 10;

}

  • (SChartAxis*)sChart:(ShinobiChart *)chart xAxisForSeriesAtIndex:(int)index {

    return [[chart allXAxes] objectAtIndex:index];

}

I assing the values for X and Y axis:

  • (id<SChartData>)sChart:(ShinobiChart *)chart dataPointAtIndex:(int)dataIndex forSeriesAtIndex:(int)seriesIndex {

    

    SChartDataPoint *datapoint = [SChartDataPointnew];

    double xValue = dataIndex /50.0;

    NSString *xSValue = [[NSString alloc] initWithFormat:@“s:%d d:%d”, seriesIndex, dataIndex];

    

datapoint.xValue = xSValue;

    datapoint.yValue = [NSNumber numberWithDouble:pow(xValue, seriesIndex + 1)];

    

    NSLog(@"\n%@", datapoint.xValue);

    

    return datapoint;

}

When debugging with NSLog I get:

s:0 d:0  <-- Start of series 0 for xAxis 0

s:0 d:1

s:0 d:2

s:0 d:3

s:0 d:4

s:0 d:5

s:0 d:6

s:0 d:7

s:0 d:8

s:0 d:9

s:1 d:0  <-- start of series 1 for xAxis 1

s:1 d:1

s:1 d:2

s:1 d:3

s:1 d:4

s:1 d:5

s:1 d:6

s:1 d:7

s:1 d:8

s:1 d:9

The result is a graph but with the Captions wrong in the second xAxis, what can i do to customize this Captions?