score:0

from your code i presume you're using an old version of chart.js.

new chart(ctx).line(data, {
  ...

charts are now created in a different way.

var mychart = new chart(ctx, {
    type: 'line',
    ...

if you switch to version 2.9.3., it works fine as the following code sample illustrates.

new chart(document.getelementbyid('mychartaxis'), {
  type: 'line',
  data: {
    labels: ['a', 'b', 'c', 'd'],
    datasets: [
      {
        label: 'warnings',
          data: [1, 2, 3, 2],
          bordercolor: 'rgb(255, 159, 64)',
          backgroundcolor: 'rgba(255, 159, 64, 0.2)'
      },
      {
        label: 'errors',
          data: [1, 2, 1, 3],
          bordercolor: 'rgb(255, 99, 132)',
          backgroundcolor: 'rgba(255, 99, 132, 0.2)'
      }
    ]
  },
  options: {
    scales: {
      yaxes: [{
        stacked: true
      }]
    }
  }
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/chart.js/2.9.3/chart.bundle.min.js"></script>
<canvas id="mychartaxis" height="90"></canvas>


Related Query

More Query from same tag