AddSeries creates reams of console errors in BlazorServer

Hi there, 

We are using the AddSeries method on SfChart to adjust the available data the user is shown based on some other controls, however whenever we call AddSeries, we get dozens of console errors around JSON deserialization.

Example code:

var seriesCollection = new List<ChartSeries>();
seriesCollection.Add(new ChartSeries { DataSource = DataSourceXName = CurrentXDataNameYName = CurrentYDataName });
await DLRepChart.AddSeries(seriesCollection);

While the errors are many versions of:

Newtonsoft.Json.JsonSerializationException: Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.Generic.List`1[Syncfusion.Blazor.Charts.ChartSeries]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly. To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List<T>) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object. Path 'zOrder', line 1, position 10.

As you can see at the end there, it's failing to find the zOrder property of the ChartSeries object - we get one error for EVERY
property available on ChartSeries (and there's a LOT of those!)

However, even with all these errors - the charts draw fine and there are no other visible issues.

I have tried updating to the latest version (we were on 18.2.0.48, have now upgraded to 18.3.0.35), but there was no change, so any hints as to
where the issue might be would be apprecaited.




8 Replies 1 reply marked as answer

SM Srihari Muthukaruppan Syncfusion Team October 9, 2020 05:10 PM UTC

Hi Goce, 
 
We have analysed your query. From that, we would like to let you know that we have already consider this scenario as a bug and logged a defect report. You can keep track of the bug from the feedback portal below.  
   
   
The fix will be available in our volume 3 SP1 release which is scheduled to be rolled out by the month of November.  
   
If you have any more specification/precise replication procedure or a scenario to be tested, you can add it as a comment in the portal.   
   
Thanks,   
Srihari 



GP Goce Petrovski October 30, 2020 07:56 AM UTC

Sorry, but I can't access that link. It brings up an access denied page.


SM Srihari Muthukaruppan Syncfusion Team October 30, 2020 02:01 PM UTC

Hi Goce, 
 
Sorry for the inconvenience. 
 
We have provided access for the below feedback link. And If you have any more specification/precise replication procedure or a scenario to be tested, you can add it as a comment in the portal. 
 
 
Let us know if you need any other assistance 
 
Regards, 
Srihari M 



TR Travis November 2, 2020 10:05 PM UTC

I'm having the same issue.  
"Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.Generic.List`1[Syncfusion.Blazor.Charts.ChartSeries]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly."

The link provided above gives "Access Denied"  when tested on 2020-11-02 


SM Srihari Muthukaruppan Syncfusion Team November 3, 2020 11:53 AM UTC

Hi Travis,  
  
We have provided access for the below feedback link. And If you have any more specification/precise replication procedure or a scenario to be tested, you can add it as a comment in the portal.  
  
  
Let us know if you need any other assistance  
  
Regards,  
Srihari M  



TR Travis November 6, 2020 06:56 PM UTC

I have found that if you add a Chart Load Event to your chart:

<ChartEvents Load="ChartLoad"></ChartEvents>

and then an event handler in your code:

 void ChartLoad(ILoadedEventArgs Args)
    {
    }

The errors stop in the console output.
While this seems to fix the AddSeries() errors, it creates a render bug (chart shifts right) when you use RemoveSeries()
The render error in RemoveSeries() can be fixed by calling Chartobj.Refresh(), but only from the UI.  It doesn't work if you call it from the same code as the RemoveSeries().  


SM Srihari Muthukaruppan Syncfusion Team November 9, 2020 06:00 AM UTC

Hi Travis, 
 
Thanks for the update. 
 
We are glad to know that you have found the solution. We also suggest you to use the provided suggestion to overcome the reported scenario. Let us know if you need any other assistance. 
 
Regards, 
Srihari M 



SM Srihari Muthukaruppan Syncfusion Team December 18, 2020 03:02 PM UTC

Hi Goce, 
  
We are glad to announce that our v18.4.30 volume 4 release is rolled out, we have added the fix for the reported scenario. And you can use the latest (18.4.30) Syncfusion.EJ2.Blazor NuGet package version and refer the provided lodash file in the host.cshtml page to get rid of the reported issue. 
  
 
  
 
We appreciate your patience in waiting for this release. Kindly let us know if you need further assistance. 
 
Regards, 
Srihari 


Marked as answer
Loader.
Up arrow icon