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 show all legend info on exported image

Hi Syncfusion team,


How to export the chart with all legend's data (Red circle on screenshot) ? Currently, the exported image only show current page. Please refer to my code as below. Thanks.


<ejs-button id="button" content="Export" iconCss="e-icons e-export-icon" cssClass="e-flat" isPrimary=true></ejs-button>

<div class="control-section col-lg-9" align='center'>

    <ejs-accumulationchart id="container" title="Mobile Browser Statistics" load="load" enableAnimation="false">

        <e-accumulationchart-center x="50%" y="50%"></e-accumulationchart-center>

        <e-accumulationchart-tooltipsettings enable="true"></e-accumulationchart-tooltipsettings>

        <e-accumulationchart-legendsettings visible="true" toggleVisibility="false">

        </e-accumulationchart-legendsettings>

        <e-accumulation-series-collection>

            <e-accumulation-series xName="x" yName="y" name="Browser" radius="70%" startAngle="0" endAngle="360" explodeIndex="5" explode="true" explodeOffset="10%">

                <e-accumulationseries-datalabel name="text" visible="true" position="Outside">

                    <e-font fontWeight="600"></e-font>

                    <e-connectorstyle type="Curve" length="20px"></e-connectorstyle>

                </e-accumulationseries-datalabel>

            </e-accumulation-series>

        </e-accumulation-series-collection>

    </ejs-accumulationchart>

</div>

<script>

     document.getElementById('button').onclick = () => {

            var chart = document.getElementById('container').ej2_instances[0];

            chart.exportModule.export("PNG", "test.png");

        };


    function load(args) {

        var indexedTheme = location.hash.split('/')[1];

        indexedTheme = indexedTheme ? indexedTheme : 'Material';

        args.accumulation.theme = (indexedTheme.charAt(0).toUpperCase() + indexedTheme.slice(1).replace(/-dark/i, 'Dark').replace(/contrast/i, 'Contrast'));


        var series1 = [];

        var point1;

        var value = 80;

        var i;

        for (i = 1; i < 80; i++) {

            if (Math.random() > .5) {

                value += Math.random();

            }

            else {

                value -= Math.random();

            }

            point1 = { x: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua" + i, y: Math.round(value) };

            series1.push(point1);

        }

        args.chart.series[0].dataSource = series1;



    }


</script>

Regards


1 Reply

SB Swetha Babu Syncfusion Team January 11, 2023 05:35 AM UTC

Hi Jinchuan,


Greetings from Syncfusion.


As of now, we do not have support to show the entire legend by ignoring the paging. However, we have considered the reported scenario as an improvement and created a feature request for the same. This improvement will be included in any of our upcoming releases. Please find the below feedback link to keep track of the reported scenario.


Feedback link: https://www.syncfusion.com/feedback/1248/export-the-chart-with-legend-details-by-ignoring-pagination


Please get back to us if you need further assistance.


Regards,

Swetha


Loader.
Live Chat Icon For mobile
Up arrow icon