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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to clean series charts

Thread ID:





129689 Mar 28,2017 09:39 PM UTC Mar 29,2017 08:20 AM UTC JavaScript 1
Tags: ejChart
Roimer Machacón Otero
Asked On March 28, 2017 09:39 PM UTC

Hi, we're using syncfusion charts, now when load initially the chart appear a serie with name "series0" and default values.

Exist a form of delete this serie, to the moment of load the chart.

We've this code:

var Chart = $("#chProduccionSiembras").ejChart("instance");
//Here hide the serie but we need remove this
                Chart.model.series[0] = { visibility: 'hidden' }

                //Adding a new series dynamically using Chart instance
                for (strName in valor) {
                    strValue = valor[strName];
                    Chart.model.series[Chart.model.series.length] = { dataSource: strValue, name: 'Siembra: ' + strName }
                //Redrawing chart after updating series collection

Dharanidharan Dharmasivam [Syncfusion]
Replied On March 29, 2017 08:20 AM UTC

Hi Roimer,  

Thanks for contacting Syncfusion support. 

We have analyzed your query. Your requirement can be achieved by following any one of the below methods. 

Method 1: Initializing the series with empty array. 
Response: You can initialize the chart with empty series, so that chart will render with empty points. In a button click we have added series to the chart dynamically. You can change this scenario, with respect to your requirement. Find the code snippet below. 


<input type="button" onclick="addSeries()" value="Add Series" /> 

          //Initializing empty series                                             
            series:[{ }], 
function addSeries() { 
        var Chart = $("#container").ejChart("instance"); 
        var data = GetData(); 
        if (Chart.model.series[0].points.length == 0 || Chart.model.initSeriesRender == false) 
        Chart.model.series = []; 
        Chart.model.series.push({ "dataSource": data.Open, "xName": "XValue", "yName": "YValue" ,    
                                                    name: 'Siembra: ' + window.count }); 

Screenshot with empty series: 

Screenshot after adding the series in button click: 


Sample for reference can be find from below link. 

Method 2: Using initSeriesRendering property. 
Response: When initSeriesRender property is set to false, then no series will be rendered in the chart. Then before redraw the chart, initSeriesRender property need to be set as true, then only chart will render with specified series. Find the code snippet below. 


<input type="button" onclick="addSeries()" value="Add Series" /> 

             initSeriesRender : false 
function addSeries() { 
        var Chart = $("#container").ejChart("instance"); 
        Chart.model.initSeriesRender = true; 

Sample for reference can be find from below link. 



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon