消除左侧Chart JS上的小缝隙

时间:2019-02-04 12:24:44

标签: javascript chart.js

我不知道如何删除图像上左侧的空间。我尝试了诸如AspectRatio之类的方法:1但不起作用。

enter image description here

这是当前配置

const config = {
  type: "line",
  data: dataSets,
  options: {
    responsive: false,
    maintainAspectRatio: false,
    elements: {
      point: { radius: 0 },
      line: {
          tension: 0,
      },
    },
    scales: {
      xAxes: [{
        type: "time",
        time: {
          unit: "day",
        },
        ticks: {
          display: false,
        },
        gridLines: {
          tickMarkLength: 1,
          color: "#d8d8d8",
          zeroLineColor: "#d8d8d8",
        },
      }],
      yAxes: [{
        ticks: {
          display: false,
        },
      }],
    },
    legend: {
      display: false,
    },
  },
};

0 个答案:

没有答案