使用y轴的时候,因为值特别的小而不能正常显示。要显示(-0.15% ~0.15%);
首先设置好最大值和最小值,然后设置最小间距,默认是1,因为太小了所以必须设置CIA能正常显示:
leftAxis.axisMaximum = 0.15;
leftAxis.axisMinimum = -0.15;
leftAxis.granularity = 0.05;
其次给个后缀然后选择一个风格:
NSNumberFormatter *leftAxisFormatter = [[NSNumberFormatter alloc] init];
leftAxisFormatter.positiveSuffix = @"%";
leftAxisFormatter.numberStyle=kCFNumberFormatterDecimalStyle;
leftAxis.valueFormatter = [[ChartDefaultAxisValueFormatter alloc] initWithFormatter:leftAxisFormatter];