There are ways to do this.
First, you can add a display:none on your <canvas> in the php/html directly. This way it won't be displayed at first.
Then, in C2, add an event "On start of layout" with the action "ExecJS" from the Browser object. This way, you can call a function that you declared on the page.
Be careful though, read the manual concerning ExecJS, as there are security issues. If possible, don't use it at all.