Chart.js #5938 test02

by Akihiko Kusanagi

HTML

<script src="https://www.chartjs.org/dist/master/Chart.min.js"></script>
<div style="overflow:hidden;">
<canvas id="chart1" width=512 height=256 style="float: left"></canvas>
</div>

JavaScript

new Chart(document.getElementById('chart1'), {
  type: 'line',
  data: {
    datasets: [{
      data: [0,1,2,3,4]
    }]
  },
  options: {
    responsive: false,
    scales: {
      xAxes: [{
        type: 'linear'
      }],
      yAxes: [{
        id: 'events',
        type: 'category',
        labels:[
          0,0,0,0,0,0,0,0,0,0,
          1,1,1,1,1,1,1,1,1,1,
					2,2,2,2,2,2,2,2,2,2,
          3,3,3,3,3,3,3,3,3,3,
          4,4,4,4,4,4,4,4,4,4
        ],
        scaleLabel: {
          display: true,
          labelString: 'Phenology'
        },
        ticks: {
          autoSkip: true
        }
      }]
    }
	}
});