When updating the data source of a StackedColumn chart to a List with fewer data points, it does not remove the points on the x-axis, but leaves them with 0 value.
I tried to reproduce it with your StackedColumnChartData example, and was able to do so (e.g. assign a new list to the data source variable, but with one fewer element in the list). Unfortunately, it did not happen consistently, so I cannot supply code to reproduce consistently.
In the attached screenshot, the data source has just been updated from a list with 20 elements to a list with 10 elements.
Is this a known issue?
Best regards, Niels
Attachment: StackedColumn_Chart_ExtraDataPoints_6fe959f8.zip
Hi Durga,
Thank you for your code example.
I have now been able to adapt your example to something that fails consistently. It becomes clear that it is the x-axis that does not update, while the rest of the graph does. The difference is that it runs in an asynchronous context, where the task update takes time (in my project code it fetches data via an API).
In the example, the problem can be solved by removing the 'await' before the call to RefreshAsync, but unfortunately this does not work in my project code - it fails with and without 'await' (displaying the old x-axis with empty columns).
I would be very grateful if you could help me determining if this is a bug, and/or perhaps suggest a solution.
Below is the updated data change code (I also attached the entire page code, but the rest is not changed).
Regards, Niels
public async Task ChangeData()
{
awaitHeavyDataUpdate();
// Original
//chartObj.RefreshAsync();
await chartObj.RefreshAsync();
}
publicasyncTaskHeavyDataUpdate()
{
// Corresponds to a data fetch through API
awaitTask.Delay(200);
this.Sales=newList
{
newSalesInfo{Month="Jul",SalesValue1=15,SalesValue2=20},
newSalesInfo{Month="Aug",SalesValue1=38,SalesValue2=26},
newSalesInfo{Month="Sep",SalesValue1=24,SalesValue2=18},
newSalesInfo{Month="Oct",SalesValue1=12,SalesValue2=32}
};
}
Attachment: Index_b5992086.zip
Hi Niels,
We are glad to announce that our v19.4.0.55 patch release is rolled out; we have added the fix for reported issue. You can use the latest Syncfusion.Blazor.Charts NuGet package version.
NuGet Package : https://www.nuget.org/packages/Syncfusion.Blazor.Charts/
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.
Regards,
Durga G
Hi Durga
Unfortunate the patch does not fix the problem. Please find attached a sample which reproduces the error using the patched version.
Best regards,
Niels
Hi Niels,
Thanks for being patience. We have fixed the reported issue and generated custom nuget with fixed changes. We request you to ensure your application by installing this custom nuget. This fix will be available in our upcoming weekly patch release which is scheduled to be rolled out on 12th April 2022. We appreciate your patience until then.
Custom NuGet : https://www.syncfusion.com/downloads/support/directtrac/general/ze/Syncfusion.Blazor.Charts.20.1.0.481373772923.zip
Kindly revert us if you have any concerns.
Regards,
Durga Gopalakrishnan.
Hi Niels,
We are glad to announce that our v20.1.0.48 patch release is rolled out; we have added the fix for reported issue. You can use the latest Syncfusion.Blazor.Charts NuGet package.
NuGet Package : https://www.nuget.org/packages/Syncfusion.Blazor.Charts/
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.
Regards,
Durga Gopalakrishnan.