Home forums Using CanvasJS How to print a page with multiple charts?

Tagged: 

This topic contains 6 replies, has 4 voices, and was last updated by  Vishwas R 3 months, 2 weeks ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #23620

    Hi.

    I would like to be able to have a button to print the page but only the charts. Not the website header and footer. So I tried using some JS print libraries to do it, as you can target the content container, e.g. PrintJS and PrintThis. But using these the CanvasJS charts are not printed.

    If I use the browser print they appear, but so does the whole page which I dont want.

    If I add in exportEnabled, its on a per chart basis. But I may have like 20 charts on a page.

    exportEnabled is actually perfect for exporting but I would need it for ALL charts on the page in one export, not individual.

    So does anyone have any ideas how to achieve this?

    Thanks a lot

    #23621

    @amityweb,

    You can merge all the charts into single image with the help of html2canvas library and then print the image. Please take a look at this JSFiddle.


    Vishwas R
    Team CanvasJS

    #23639

    That totally worked! Thats great, thanks a lot!

    #24944

    How to do it can you share some stuff?

    #24955

    @hassanmoin21,

    Please take a look at this JSFiddle – which is already mentioned in the previous reply-post.


    Vishwas R
    Team CanvasJS

    #26114

    but how can the legend in the pie chart be seen when printed with html2canvas?

    • This reply was modified 3 months, 2 weeks ago by  Ady Shaputra.
    • This reply was modified 3 months, 2 weeks ago by  Ady Shaputra.
    #26122

    @ady-shaputra,

    It seems to be exporting along with the chart legend.
    Export CanvasJS Charts with html2canvas

    If you are still facing the issue, kindly create JSFiddle reproducing the issue you are facing and share it with us so that we can look into it and help you resolve.


    Vishwas R
    Team CanvasJS

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

You must be logged in to reply to this topic.