Download chart as JPEG or PDF


How can I download charts as JPEG/PNG/GIF any image format or PDF format?

Unfortunately it is not possible in the current version.

Please guide how it could be implemented -> please suggest some libraries to do it
we need to support that functionality

also put that charts (coverted to graphic formats) in reports.

we have finished implementation all the functionality of the module
but the download and reports modules are held up as we cant get charts in graphics format.

Your help will be highly appreciated.
Thank you,

Do you need to support such functionality in IE8, IE7 ?
If ignore that browsers - other ones allows to export canvas as image, which can be used for partial chart exporting.

Functionalities of our web application is supported in

IE9 + all major browser

however some functionalities does not work in IE7 and IE8.

So please point me to code (provide a sample) which can do the export of charts to PNG and JPG.

Thank you so much for your support.

You may use the getCanvas() of a chart to get canvas and then call toDataURL:

var canvas = yourChart.getCanvas();
var img = canvas.toDataURL(“image/png”);

var canvas = yourChart.getCanvas();
I was succesful with the above

but firebug complains that such toDataURL does not exists.
var img = canvas.toDataURL(“image/png”);

please help.

Sorry, please call the following

var canvas = yourChart.getCanvas().canvas;

instead of

var canvas = yourChart.getCanvas();


I was going through this post for exporting my dhtmlx chart to excel.
my code snippet:
that.mychart = graphattachLayout.cells(“b”).attachChart({
view : “bar”,
value : “#Distance#”,
/////// (rest of chart properties, chart is displayed properly on my layout)

on this chart element I am calling:

I am getting exception:
that.mychart.getCanvas is not a function

Please help at the earliest

the original post and the solution is from the 2011.
Unfortunately currently there is no export to canvas feature in the dhtmlxChart.

Thanks for the reply, I used html2Canvas to solve this problem…
But have an issue with css rotated text… :frowning:

Could you please, clarify your issue.