Angular 角度:chart.js图表未显示

Angular 角度:chart.js图表未显示,angular,chart.js,Angular,Chart.js,我正在使用Angular,我已经安装了chart.js,但是该图表没有显示在页面中 这是我的密码: dasboard.component.html <canvas id="myChart" width="400" height="400"></canvas> 当我这样做的时候 console.log('hello'); 在dashboard.component.ts中,它正在控制台中打印,但图形没有显示如何解决此问题?您的代码很好,只需将画布包含到div中,它就会显示

我正在使用Angular,我已经安装了
chart.js
,但是该图表没有显示在页面中

这是我的密码:

dasboard.component.html

<canvas id="myChart" width="400" height="400"></canvas>
当我这样做的时候

console.log('hello');

dashboard.component.t
s中,它正在控制台中打印,但图形没有显示如何解决此问题?

您的代码很好,只需将
画布
包含到
div中,它就会显示出来

<div>
  <canvas id="myChart" width="400" height="400"></canvas>
</div>


请查看以下内容

开发者窗口中是否存在任何控制台错误?如果您被卡住了,请欣赏本教程@ArunRajR没有错误……它没有显示任何内容。我认为您可以使用专门为角度项目开发的角度图框架的更好替代方案[ngx图表],您也可以在github上找到它
<div>
  <canvas id="myChart" width="400" height="400"></canvas>
</div>