[Chartjs]-Chart js doesn't show chart

3👍

You are using chart js v2 syntax on v1.

for v1

var barChartData = {
  labels: ["January", "February", "March", "April", "May", "June", "July"],
  datasets: [{
    label: 'Dataset 1',
    borderWidth: 1,
    data: ["1","1","1","1","1","1","1"]
  },
  {
    label: 'Dataset 2',
    borderWidth: 1,
    data: ["1","1","1","1","1","1","1"]
  }]
};

window.onload = function() {
  var ctx = document.getElementById("zeitsteuerungChart").getContext("2d");
  var myBar = new Chart(ctx).Bar(barChartData, options);
};

you can view chart options (chart js v1) here or complete options here

Leave a comment