CorePlot CPTXYGraph Y轴整数不是小数

How*_*rdP 1 core-plot

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

and*_*tis 5

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

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

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

    y.labelFormatter = yLabelFormatter
Run Code Online (Sandbox Code Playgroud)