Im created a canvas in the HTML Block, name myCanvas.
<div>
<canvas id=”myCanvas” style=”border:1px solid #000000; margin-right: auto; margin-left: auto; display: block;”></canvas>
</div>
In a script I want to create a graph but this does not seem to work:
var chart = new CanvasJS.Chart(“myCanvas”,{
title :{
text: “Live Data”
},
axisX: {
title: “Axis X Title”
},
axisY: {
title: “Units”
},
data: [{
type: “line”,
dataPoints : dps
}]
});
chart.render();
I just copied some code from the examples, but even that does not seem to work.
Does ConvasJS only work when the id= a block, or is there a way to make it work with a canvas?