<canvas id = "myCanvas" height = "385%" width = "100%">
<script type="text/javascript" charset="utf-8"> <pre>
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
var bar = new RGraph.Bar(ctx);
bar.Set('test', [4.5,3.5,3,4,3.5,2.5,2.5,3]);
bar.Set('chart.gutter', 7);
bar.Set('chart.colors', ['blue']);
bar.Set('chart.labels'["Avengers:InfinityWar","Deadpool2","BlackPanther","Padmavat","Sanju","Gotti","Jurasic World:Fallen World","Rampage"]);
bar.Draw();</pre>
</script>
</canvas>
错误:未捕获的类型错误:无法在文件中的新 RGraph.Bar (file:///F:/New%20folder%20(2)/website/RGraph.bar.js:46:51) 处读取 null 的属性“getContext” :///F:/New%20folder%20(2)/website/online_booking.html:149:14