Chartjs-Chart.js sets canvas dimentions to 0x0 and do not display anything

0👍

The chart is not visible because the component host is an inline element. As such, it should not contain block elements like the div wrapper created by the Chart.js library.

Setting the display style attribute of the host to block or inline-block will make the chart visible:

:host {
  display: inline-block;
}

See this stackblitz for a demo.

Leave a comment