I wrote this sctipt that creates an Line Chart on an existing canvas:
var myLineChart = new Chart(ctx).Line(data, options);
And on animation Complete it opens the generated Line Chart-Canvas in a new tab:
var options = { onAnimationComplete: function(){
window.open(canvas.toDataURL());
}}
Here you can test it out: https://jsfiddle.net/ds53js5u/3/
What I try to achieve:
Is to also generate the canvas with Jquery
I replaced:
<canvas id="myChart" width="400" height="400"></canvas>
With:
var canvas = $('<canvas/>', {id: "myChart", width: 400, height: 400});
DEMO: https://jsfiddle.net/ds53js5u/4/
But now It doesn't any more generate the DataUrl and open it in the new window! What do i wrong?
It is important for me that the canvas is never drawn to the document!
THANKS
animation: false,to youroptions