Chart.js #6300 test02

by Akihiko Kusanagi

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/nagix/nagix.github.io@chartjs/Chart.6300.js"></script>
<div>
  <canvas id="chart" width=270 height=100></canvas>
</div>

JavaScript

new Chart(document.getElementById("chart"), {
  type: 'line',
  data: {
    labels: ['2015-01-01', '2015-02-01', '2015-03-01', '2015-04-01', '2015-05-01', '2015-06-01']
  },
  options: {
    responsive: false,
    legend: {
      display: false
    },
    scales: {
      xAxes: [{
        type: 'time',
        time: {
          unit: 'month'
        },
      }],
      yAxes: [{
          type: 'linear',
          display: true,
          scaleLabel: {
            display: true,
            labelString: 'y1'
          }
        },
        {
          type: 'time',
          display: true,
          position: 'right',
          scaleLabel: {
            display: true,
            labelString: 'y2'
          }
        },
      ],
    }
  }
});