We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to Print chart

Hi

I wonder if there is an easy way to print the chart from javascript and not the whole web  page.

Thank you
George

1 Reply

DD Dharanidharan Dharmasivam Syncfusion Team June 28, 2017 06:15 AM UTC

Hi George, 

Thanks for contacting Syncfusion support. 

We have analyzed your query. We would like to let you know that we have provided support for printing the chart from Essential Studio version 15.2.0.40, so if you are using the lower version, you can upgrade to the current version from the below link. 


We have prepared a sample for printing the chart in a button click. In the print method you need to pass the id of the chart element which need to be exported. In the sample we have used the current version (15.2.0.43) minified web all file. Find the code snippet below to achieve your requirement. 

ASP.NET Core: 

<input type="button" onclick="printChart()" value="Print Chart" /> 
 
<ej-chart id="container" > </ej-chart> 
 
function printChart() { 
        var chart = $("#container").ejChart("instance"); 
        chart.print("container"); 
    } 


Screenshot: 
 

Sample for reference can be find from below link. 
 
For more information on printing, follow the below link. 

Thanks, 
Dharani. 


Loader.
Up arrow icon