Chartjs-How to create float charts with chartjs?

0👍

You need a 2d context to draw the chart on. Here’s a working example:

Edit delicate-rgb-mms78

Do these 2 changes in your code:

HTML

<canvas id="bar-chart" width="400" height="400"></canvas>

Javascript

var ctx = document.getElementById("bar-chart").getContext("2d");
var myBarChart = new Chart(ctx, ...)

Source: https://www.chartjs.org/docs/latest/#creating-a-chart

Leave a comment