[Chartjs]-Chart.js canvas and chart width gets overwritten when redrawn

2👍

It seems like the library you’re using (chart.js) is overriding those css values by default.

One option is to set those values back to their correct values at the end of createChart function.

For example:

tempChart.style.width = 45%;

Other option is add a high power to them in a stylesheet, !important, but this depends on the way (chart.js) is acting.

Leave a comment