Home Forums Chart Support Export Multiple chart in one pdf

Export Multiple chart in one pdf

Viewing 4 posts - 1 through 4 (of 4 total)
  • #22345

    Its working fine when 3 charts . its exports correctly.
    but if more than 5 charts pdf size will change but chart not show in pdf.



    We don’t have exporting chart as pdf as an inbuilt feature as of now. However with couple of lines of code you can export chart as pdf using jsPDF. Please find the code-snippet below.

    var pdf = new jsPDF();
    pdf.addImage(dataURL, 'JPEG', 0, 0);

    Please take a look at this JSFiddle for complete code.
    exporting chart as pdf using jspdf

    To export multiple charts present in a page, you can merge all charts into single using html2canvas. And then you can export the merged images to pdf using jspdf. Please take a look at this JSFiddle for an example on the same.

    Exporting more than 5 charts also seems to be working fine, when you configure html2canvas options accordingly. Please take a look at this updated JSFiddle. Please refer html2canvas documentation for more configuration options available and configure it in your webpage / app accordingly.

    Vishwas R
    Team CanvasJS

    • This reply was modified 7 months, 1 week ago by Vishwas R.

    I need to export multiple charts from a single page. Exporting first chart is ok but when I try to export 2nd chart, the chart exports successfully but the chart rendered in PDF from the x-coordinate(say 400px of the window) where the width of first chart was ended because of which half of the second chart is hidden. Could you please suggest me to solve this issue. Might be we need to refresh html2canvas?




    Exporting multiple charts (morethan 5) also seems to be working fine – charts are positioned vertically and not one next to other. Can you kindly share JSFiddle reproducing the issue you are facing so that we can look into your code, understand it better and help you out?

    Also refer documentation of jsPDF and html2canvas for more available options like offsets / position of an element while exporting DOM as PDF.

    Vishwas R
    Team CanvasJS

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.