You cannot do anything with JavaScript, because email clients do not parse it.
But you can tell your server to set the header in the file to make it JPEG or GIF. The file extension should also be jpg or gif, because some email clients fade away when rendering an image that does not have an extension, or has an extension without an image. Not sure if you are using a server room, but most of them have some kind of dynamic library for creating images.
Alternatively, visualize the graph using tables.
<table> <tr> <td colspan="10" bgcolor="pink"></td> </tr> <tr> <td colspan="5" bgcolor="pink"></td> <td colspan="5" bgcolor="white"></td> </tr> </table>
You get the idea. Unfortunately, you need to write something to create the appropriate HTML.
source share