mileageChart.js 941 Bytes
const mileageChart = {
  type: 'line',
  data: {
    labels: [],
    datasets: [{
        data: [],
        label: '行驶里程(米)',
        borderDash: [1],
        backgroundColor: 'rgba(0,153,68,0.3)',
        borderColor: 'rgba(0,153,68,0.8)',
        borderWidth: 1
    }]
  },
  options: {
    responsive: true,
    maintainAspectRatio: false,
    legend: false,
    tooltips: {
      intersect: false,
      displayColors: false
    },
    scales: {
        yAxes: [{
            ticks: {
                beginAtZero:true,
                //stepSize: 1,
                callback: function(value, index, values) {
                    if (Math.floor(value) === value) {
                        return value;
                    }
                },
                autoSkip: true,
                maxRotation: 10,
                maxTicksLimit: 10
            }
        }],
        xAxes: []
    }
  }
}

export default mileageChart;