Chart does not refresh after updating ChartSeries DataSource

Hi,

We have upgrade from version 18.0.2.59 to 18.0.3.42 and now our Chart does not refresh after updating ChartSeries DataSource.
Do you know how to make it work again?

Best regards,

Igor Surla

3 Replies 1 reply marked as answer

DG Durga Gopalakrishnan Syncfusion Team November 2, 2020 07:35 AM UTC

Hi Igor, 

We have ensured your reported scenario with specified version 18.0.3.42, but we are unable to reproduce an issue. We were able to update the chart series data source in that version. We have attached the sample for your reference. We have updated data source on button click. 
  
Before Update 

 
After Update 

 


Kindly revert us, if you have any concerns. 

Regards, 
Durga G 



IS Igor Surla November 2, 2020 10:08 AM UTC

Hi Durga,

If in you example change your ChangeData method to be like this your will be able to reproduce issue:
void ChangeData()
    {
        DataSource.Clear();
        DataSource.Add(new ColumnChartData { x = "AUS", y = 26, y1 = 27, y2 = 32 });
        DataSource.Add(new ColumnChartData { x = "IND", y = 37, y1 = 13, y2 = 24 });
        DataSource.Add(new ColumnChartData { x = "EUR", y = 16, y1 = 28, y2 = 16 });
    }

Best regards,

Igor Surla


DG Durga Gopalakrishnan Syncfusion Team November 5, 2020 02:57 PM UTC

Hi Igor, 

We have checked the sample with your provided code snippet. As of now, we are facing problem while clearing and adding the datasource for chart series. We suggest you to use ClearSeries and AddSeries methods to remove and add series for chart. We have modified sample and attached the same for your reference. 

void ChangeData() 
    { 
        DataSource = new List<ColumnChartData> 
        { 
        new ColumnChartData { x = "AUS", y1 = 26, y2 = 27, y3 = 32 }, 
        new ColumnChartData { x = "IND", y1 = 37, y2 = 13, y3 = 24 }, 
        new ColumnChartData { x = "EUR", y1 = 16, y2 = 28, y3 = 16 } 
        }; 
        chartObj.ClearSeries(); 
        List<ChartSeries> seriesCollection = new List<ChartSeries>(); 
        for(int i = 1; i <= 3; i++) 
        { 
            seriesCollection.Add( 
                    new ChartSeries 
                    { 
                        XName = "x", 
                        YName = "y" + i, 
                        Type = ChartSeriesType.Column, 
                        DataSource = DataSource 
                    } 
                ); 
        } 
        chartObj.AddSeries(seriesCollection); 
    } 


Please revert us, if you have any concerns. 

Regards, 
Durga G 


Marked as answer
Loader.
Up arrow icon