B. Jansen,
‘error: CanvasJS not defined’ is thrown when canvasjs.min.js is not loaded but chart render() is called.
Rendering chart with local js-file or from website should work fine. Kindly create jsfiddle with your issue, so that we can look into it and help you out.