Chartjs-Chart.js Bar chart resizes again when revisiting the tab

0👍

Solved it like this. In the Bar chart options:

scales: {
  xAxes: [{
    display: true,
    ticks: {
      display: false,
      callback: function(value, index, values) {
        return `${value.date}, ${value.time}`;
      }
    }
  }]
}

Though I would’ve thought display: false would turn off the ticks at the very creation (initialization) of the Bar chart still at the full screen size the ticks are there when the page first loads.

Comments or explanations are welcome.

Leave a comment