Skip to content

Exporting a Chart

Yeray edited this page Mar 22, 2018 · 2 revisions

Exporting a Chart

To obtain a PNG or JPEG image from a chart, you can use the canvas toDataURL method, or the included toImage function.

Chart1.toImage( “img” );              // fills <img id=”img”> element with chart as PNG image.
Chart1.toImage( “img” , “jpg”, 90 );  // fills image with a jpeg image with 90% compression 
Clone this wiki locally