使用y軸的時候,因為值特別的小而不能正常顯示。要顯示(-0.15% ~0.15%)椰棘;
首先設(shè)置好最大值和最小值纺棺,然后設(shè)置最小間距,默認(rèn)是1邪狞,因為太小了所以必須設(shè)置CIA能正常顯示:
leftAxis.axisMaximum = 0.15;
leftAxis.axisMinimum = -0.15;
leftAxis.granularity = 0.05;
其次給個后綴然后選擇一個風(fēng)格:
NSNumberFormatter *leftAxisFormatter = [[NSNumberFormatter alloc] init];
??? leftAxisFormatter.positiveSuffix = @"%";
??? leftAxisFormatter.numberStyle=kCFNumberFormatterDecimalStyle;
??? leftAxis.valueFormatter = [[ChartDefaultAxisValueFormatter alloc] initWithFormatter:leftAxisFormatter];