我希望我的图表的x轴看起来像这样:
1月、2月、3月、4月......11月、12月
目前它按照数据点数量默认编号。
我该如何实现这种轴的更改?
我尝试使用分类轴,并将包含这些字符串(“Jan”,“Feb”...)的NSMutableArray设置为类别,并使用从1到12的数字范围,但没有成功。
1月、2月、3月、4月......11月、12月
目前它按照数据点数量默认编号。
我该如何实现这种轴的更改?
我尝试使用分类轴,并将包含这些字符串(“Jan”,“Feb”...)的NSMutableArray设置为类别,并使用从1到12的数字范围,但没有成功。
chart = [[ShinobiChart alloc] initWithFrame:chartEmbaixo.frame withPrimaryXAxisType:SChartAxisTypeCategory withPrimaryYAxisType:SChartAxisTypeNumber];
NSMutableArray * monthNames = [[NSMutableArray alloc] initWithObjects:@"Jan", @"Fev", @"Mar", @"Abr", @"Mai", @"Jun", @"Jul", @"Ago", @"Set", @"Out", @"Nov", @"Dez", nil];
SChartNumberRange * numberRange = [[SChartNumberRange alloc] initWithMinimum:[NSNumber numberWithInt:1]andMaximum:[NSNumber numberWithInt:12]];
SChartCategoryAxis *xAxis = [[SChartCategoryAxis alloc] initWithRange:numberRange];
xAxis.categories = monthNames;
chart.xAxis = xAxis;