Skip to content Skip to sidebar Skip to footer

Chart.js Unable To Create Chart

I'm trying to create a simple bar chart using Chart.js, but every time I try to render it, it give me the following error: Failed to create chart: can't acquire context from the gi

Solution 1:

You have to add a canvas element as the base of the chart. Change the html to:

<divclass="chart-container"><canvasid="chart"></canvas></div>

Solution 2:

Instead of div please use canvas like below.

<canvas id="chart"></canvas>

Post a Comment for "Chart.js Unable To Create Chart"