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

No Animation when Chart DataSource is Updated

When I load the ChartSeries datasource on the OnInitializedAsync() method, the Series appears on the Chart with an animation.
Then, When I make changes the datasource ( creating a new source ), the data appears well and correctly but without the animation.
How can I update the ChartSeries AND show the animation?

<EjsChart>
                <ChartPrimaryXAxis ValueType="Syncfusion.EJ2.Blazor.Charts.ValueType.Category"></ChartPrimaryXAxis>
                <ChartSeriesCollection>
                    <ChartSeries  DataSource="@lstItemsChart" XName="Hora" YName="Valor" Type="ChartSeriesType.Column">
                    </ChartSeries>
                </ChartSeriesCollection>
  </EjsChart>
<button @onclick="UpdateChart()">Update</button>

@code
{
public List<ItemChartDiaCanalHora> lstItemsChart { set; get; }
protected override async Task OnInitializedAsync()
{

       lstItemsChart = dal.GetChartData(1);
// The charts loads with animation OK.

 }

void UpdateChart()
{
      lstItemsChart = dal.GetChartData(1);
// The chart updates the data OK, but no animation.

}
}

1 Reply

SM Srihari Muthukaruppan Syncfusion Team October 21, 2019 03:19 AM UTC

Hi Ricardo, 
 
We have analyzed your query. From that, we would like to let know that by default, the animation occurs only at initial rendering and it does not work while changing the datasource. To achieve your requirement, we suggest you to remove the series from chart and then add the series using “RemoveSeries()” and “Addseries()” method respectively. Based on that we have a sample for reference. Please find the sample below. 

 
Let us know, if you have any concerns. 
 
Regards 
Srihari M 


Loader.
Live Chat Icon For mobile
Up arrow icon