After implementing chart.js, I encountered a strange issue where my charts would inexplicably shrink to nothing. It appears that there is a new bug in the chart.js library causing this unintended and unwanted shrinking effect.
var scanCountChart = new Chart("ScanCountChart", {
type: "bar",
data: {
labels: xVals,
datasets: [{
backgroundColor: barColors,
data: yVals
}]
},
options: {
plugins: {
tooltip: {
titleFont: {
size: 50
},
bodyFont: {
size: 30
},
footerFont: {
size: 15 // there is no footer by default
}
},
legend: { display: false },
zoom: {
limits: {
y: { min: 0, max: 100 },
y2: { min: -5, max: 5 }
},
}
},
scales: {
x: {
ticks: {
font: {
size: xFontSize
},
maxRotation: 45,
minRotation: 25
}
},
y: {
ticks: {
font: {
size: yFontSize
}
}
}
}
}
});