How do I remove CSS code arriving in my webpage?

đź‘Ť:1

Ok, after some research, I realized that the code causing this problem has nothing to do with Zabbix. It is actually a feature of Chart.js. Apparently, the library scales charts to fit the viewable width of the browser by default unless you set the “responsive” option to “false” when defining the chart. So, I changed the “myChart” variable definition to:

var myChart = new Chart(ctx, {
   type: 'line',
   data: {
      labels: ['M', 'T', 'W', 'T', 'F', 'S', 'S'],
      datasets: [{
         label: 'apples',
         data: [12, 19, 3, 17, 6, 3, 7],
         backgroundColor: "rgba(153,255,51,0.4)"
      }, {
         label: 'oranges',
         data: [2, 20, 22, 5, 2, 3, 10],
         backgroundColor: "rgba(255,153,0,0.4)"
      }]
   },
   options: {
      responsive: false
   }
});

It’s that “responsive: false” in the options section that controls this behavior. So I was able to correct the issue that way. Thank you all for the comments and I’ll try to rtfm next time!

Leave a comment