代码之家  ›  专栏  ›  技术社区  ›  Shannon Hochkins

图表.js-缩小图例以适应数据

  •  0
  • Shannon Hochkins  · 技术社区  · 6 年前

    有一个非常简单的图表,数据集中有3个系列,但是我想缩小图表,这样就不会用空格缩放到下个月,有没有这个选项?

    我觉得我什么都试过了,看看右边怎么包括Jun,因为最后一项的日期大概是2019-05-02,但如果可能的话,我想把空格隐藏起来!

    My example chart

    xAxes: [{
      stacked: true,
      beginAtZero: true,
      bounds: 'ticks',
      ticks: {
        stepSize: 1,
        min: 0,
        autoSkip: true
      },
      type: 'time',
      position: 'bottom',
      time: {
        tooltipFormat: 'YYYY/MM/DD',
        unit: 'month',
      },
      scaleLabel: {
        display: true,
        labelString: 'Date Range',
        fontSize: 20
      }
    }]
    
    0 回复  |  直到 6 年前
        1
  •  0
  •   HeadhunterKev    6 年前

    bounds: 'ticks' .

    如果你写信 bounds: 'data' (或者仅仅因为 data

    推荐文章