You must be logged in to post your query.
Home › Forums › Chart Support › Exporting chart with padding around canvas
Tagged: borders, export, padding
Hi all,
I need to set up padding (or borders) around whole canvas chart. I have tried to use css and it worked well in browsers but in exports it did not. I use this for export:
canvas = $('#container .canvasjs-chart-canvas').get(0); img = canvas.toDataURL("image/jpeg");
Thanks!
@bajlo,
You can add a padding/border to the DIV(container) then capture the image of the DIV(container) using html2canvas library and export the image. Please take a look at this jsfiddle.
____________ Indranil Deo, Team CanvasJS
Thanks Indranil, I know about html2canvas but for me it’s an ugly solution to use another plugin just for adding padding around container. In my opinion cavnasJS is a nice and complex plugin, just this one think…
I definitely suggest adding this standard functionality to the next upgrade!
Thanks for the suggestion.
You must be logged in to reply to this topic. Login/Register