Using Createjs and Chartjs

Using Createjs and Chartjs

本文关键字:Chartjs and Createjs Using      更新时间:2024-05-11

我目前正在尝试使用chartjs制作图表,并使用createjs将其定位到舞台中。关于如何将chartjs图表(雷达)放入createjs画布阶段,有什么想法吗?

看起来chart.js是基于画布的。您可以使用画布作为EaselJS位图的源,并将其包含在您的内容中。

var chart = document.getElementById("chart-canvas-id");
var bmp = new createjs.Bitmap(chart);
stage.addChild(bmp);
stage.update();

EaselJSStage需要子对象作为显示对象,因此这可能是处理chart.js内容的最佳方式。