Core plot CorePlot CPTXYGraph Y轴整数非十进制

Core plot CorePlot CPTXYGraph Y轴整数非十进制,core-plot,Core Plot,在CorePlot CPTXYGraph中,是否可以在Y轴上显示int值而不是十进制值?只需创建一个数字格式化程序并将其应用于Y轴即可。像这样的 NSNumberFormatter *yLabelFormatter = [[NSNumberFormatter alloc] init]; [yLabelFormatter setGeneratesDecimalNumbers:NO]; CPTXYAxisSet *axisSet = (CPTXYAxisSet *)grap

在CorePlot CPTXYGraph中,是否可以在Y轴上显示int值而不是十进制值?

只需创建一个数字格式化程序并将其应用于Y轴即可。像这样的

    NSNumberFormatter *yLabelFormatter = [[NSNumberFormatter alloc] init];
    [yLabelFormatter setGeneratesDecimalNumbers:NO];

    CPTXYAxisSet *axisSet = (CPTXYAxisSet *)graph.axisSet;
    CPTXYAxis *y = axisSet.yAxis;

    y.labelFormatter = yLabelFormatter

只需创建一个数字格式化程序并将其应用于y轴。像这样的

    NSNumberFormatter *yLabelFormatter = [[NSNumberFormatter alloc] init];
    [yLabelFormatter setGeneratesDecimalNumbers:NO];

    CPTXYAxisSet *axisSet = (CPTXYAxisSet *)graph.axisSet;
    CPTXYAxis *y = axisSet.yAxis;

    y.labelFormatter = yLabelFormatter

已解决:NSNumberFormatter*numberFormatter=[[NSNumberFormatter alloc]init]autorelease];[NumberFormatterSetNumberStyle:NSNumberFormatterNoStyle];[numberFormatter setMaximumFractionDigits:0];[数字格式设置正格式:@“####0”];已解决:NSNumberFormatter*numberFormatter=[[NSNumberFormatter alloc]init]autorelease];[NumberFormatterSetNumberStyle:NSNumberFormatterNoStyle];[numberFormatter setMaximumFractionDigits:0];[数字格式设置正格式:@“####0”];