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
close icon

Add series to Accumlation Pie Chart


I need to add a series to a pie chart dynamically. Could anyone please assist me on the matter.


1 Reply

DD Dharanidharan Dharmasivam Syncfusion Team March 18, 2019 07:27 AM UTC

Hi Rikard, 
Greeting from Syncfusion.  
We have analyzed your requirement. Your requirement can be achieved by initializing the empty series and then you can add the series dynamically. Find the code snippet below to achieve this requirement. 
<ejs-accumulationchart id="pieChart"> 
                Initialized the empty series 
function addSeries(args) { 
        var chart = document.getElementById('pieChart').ej2_instances[0];   
        var seriesData = { type: 'Pie', dataSource: [{ x: 'X1', y: 14 }, 
                                        ], xName: 'x', yName: 'y' 
        Assign the properties to chart from your data source and refresh the chart 
        chart.series[0].dataSource = seriesData.dataSource; 

Live Chat Icon For mobile
Up arrow icon