Convert jqplot chart to image

I am trying to convert all jqplot chart graphics, including its legend and chart title, into an image. However, using toDataURL and the steps in this post ( Convert canvas to image and open in a new window using ruby ​​on rails and javascript ), I can only convert the chart with it to indicate the axis and axis. image

Since the name of the legend and diagram is not displayed on the canvas, they are not converted.

Can someone tell me how to convert the title of the chart and the legend with the canvas, please?

+5
source share
2 answers

Since the header and axes are div, not img or canvas, I think the only solution would be to write every text in the canvas using the fillText () function. Then convert this to an image.

You can write in canvas as follows: fillText ("Hello World!", X, y);

Now you can add this to jQplot as a plugin :)

Good luck.

+3
source

I am working on a simple implementation. It is linked here https://bitbucket.org/cleonello/jqplot/issue/14/export-capabilities#comment-554274 It should support every example that is distributed using jqplot.

+2
source

All Articles