When saving a chart as an image you have two choices on how to do it:
Here are a couple of tutorials on how the save as image with javascript works: