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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

No Animation when Chart DataSource is Updated

Thread ID:

Created:

Updated:

Platform:

Replies:

148371 Oct 17,2019 02:56 AM UTC Oct 21,2019 03:19 AM UTC Blazor 1
loading
Tags: Charts
Ricardo Martinez
Asked On October 17, 2019 02:56 AM UTC

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.

}
}

Srihari Muthukaruppan [Syncfusion]
Replied On 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 


CONFIRMATION

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

Live Chat Icon For mobile
Live Chat Icon