Extend the usage of saving canvas as image to outside flot by adding a canvasAsImage.js file.