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

Chart within PDF control

Is there an example where i can create a chart, then output it in the PDF document which the PDF control creates.

Many thanks

1 Reply

SM Srihari Muthukaruppan Syncfusion Team October 14, 2019 04:43 AM

Hi Martin 

Greetings from syncfusion 

We have validated your query. From that, we would like to let you know that, currently we can export the chart rendered as image to the PDF usingexport” method available in export module, in which “PDF” format and file name can be passed as an arguments. Based on that we have prepared a sample and also provided the code snippet for your reference. 
Code Snippet:     
<div class="control-section col-lg-9" align="center"> 
    <ejs-chart id="container" > 
        <e-chart-primaryxaxis valueType="Category" title="Countries"></e-chart-primaryxaxis> 
            <e-series dataSource="ViewBag.dataSource" xName="xValue" yName="yValue" type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column"> 
    document.getElementById('button').onclick = () => { 
        var chart = document.getElementById('container').ej2_instances[0]; 
        chart.exportModule.export("PDF", 'chart'); 
Before click 
After click 
Please let me know, if you have any concerns.   

Live Chat Icon For mobile
Up arrow icon