Search code examples
javascriptjquerycanvaschart.jscreatejs

Using Createjs and Chartjs


I'm currently trying to use chartjs to make the chart and use createjs position it into the stage. Any ideas on how to puts a chartjs chart(radar) into createjs canvas stage?


Solution

  • It looks like chart.js is canvas-based. You can use a canvas a a source for an EaselJS bitmap, and include it in your content.

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

    The EaselJS Stage requires children to be a display object, so this is probably the best way to work with chart.js content.