[Chartjs]-Chartjs Graph is not showing in colorbox

2👍

Chart.js needs the canvas to have a rendered size before it can be rendered. So you need to have your chart initialization inside the cbox_complete event hook instead of doing it first and then opening the colorbox

Something like

$(document).bind('cbox_complete', function () {
    var DoughnutChart = [{
        ...

        ...
    var myDoughnutChart = new Chart(document.getElementById("canvas").getContext("2d")).Doughnut(DoughnutChart);
});

Leave a comment