【问题标题】:Core-Plot Set number of labels per axisCore-Plot 设置每个轴的标签数
【发布时间】:2014-03-08 12:49:29
【问题描述】:

我们可以在使用 core-plot 时设置每个轴的标签数量吗?我试图在 core-plot 的帮助下绘制 19 个数据点,但由于我的图表很小,标签重叠。

所以我可以说 y 轴应该只显示 3 个标签吗?我不想手动设置标签。我想使用 scaleToFitPlots 并说“在 y 轴上仅显示 3 个标签”。

【问题讨论】:

    标签: ios iphone cocoa-touch plot core-plot


    【解决方案1】:

    创建轴时,将标签策略设置为CPTAxisLabelingPolicyAutomatic。例如,

    CPTXYAxis *x = [[CPTXYAxis alloc] init];
    x.coordinate                  = CPTCoordinateX;
    x.labelingPolicy              = CPTAxisLabelingPolicyAutomatic;
    // ...
    

    这将自动为您的轴标签确定一个合理的数字和位置。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-23
      • 1970-01-01
      相关资源
      最近更新 更多