[Chartjs]-Chart.js not displayed in angular2 (rc1)

9👍

Try updating your template and wrap your canvas-element inside a div. Don’t know the cause to it but the problem seems to appear when the canvas-element is at the root of the template html.

Updated template:

<h2>Statistic</h2>
<div>
  <canvas #canvas id="canvas"></canvas>
</div>

0👍

Have you considered looking into an existing adaptation to ChartJs with Angular2. For example
ng2-charts is a great alternative that you might be able to utilize that makes it easier to incorporate into your angular2 app.

Leave a comment