Hi,
I’m trying to integrate a chart.js into my website.
This chart will only appear on a subpage, so I modified just that page settings and added:
in the inside tag and starting with a <
script src=“https://raw.githubusercontent.com/chartjs/Chart.js/master/dist/Chart.js”>
and in the before tag:
var chrt = document.getElementById(“mycanvas”).getContext(“2d”);
var myarr = [65, 59, 80, 81, 56, 55, 40];
var data = {
labels: [“January”, “February”, “March”, “April”, “May”, “June”, “July”], //x-axis
datasets: [
{
label: “My First dataset”, //optional
fillColor: “rgba(220,220,220,0.8)”,
strokeColor: “rgba(220,220,220,0.8)”,
highlightFill: “rgba(220,220,220,0.75)”,
highlightStroke: “rgba(220,220,220,1)”,
data: [65, 59, 80, 81, 56, 55, 40] // y-axis
},
{
label: “My Second dataset”, //optional
fillColor: “rgba(220,120,220,0.8)”,
strokeColor: “rgba(220,120,220,0.8)”,
highlightFill: “rgba(220,220,220,0.75)”,
highlightStroke: “rgba(220,220,220,1)”,
data: myarr
}
]
};
var myFirstChart = new Chart(chrt).Bar(data);
And finally, in a html widget:
When I publish my website, I only see the empty space of the html widget with the dimensions that appear on the widget (400x400px).
What am I doing wrong ?
Thank you
Here is an example :