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

Generating and Saving Multiple Charts In Quick Succession -- i.e Working around rendering lag when saving SfCharts

Hello everyone. I'm wondering if any of you have had success saving charts immediately/near immediately after rendering them. I've tried several different methods, but no matter what I encounter an exception of some kind (usually an ArrayOutOfBounds from inside the SfChart when Save is called) and thus I have had to scrap an entire feature of our company's software.

Things I've tried:
1. Issuing a save in the OnLoaded callback for each chart.
2. Rendering and saving the charts using the Hwnd / RootVisual method for a clone of each chart.
3. Doing both of those while called in the main WPF UI thread (Application.Dispatcher.)
4. Putting manual waits (Task.Delay.Wait) after each attempted render.

Theories on what's wrong:
1. SyncFusion bug of some kind (such as waiting on some other update to properly render itself.)
2. I didn't properly put everything on the UI thread.
3. The callbacks preempted each other thus only the last chart was actually saved.

That's pretty much what I've figured out about this issue. If anyone else has tried or, better yet, succeeded in this task then please let me know what you did. If you have any other possible workarounds I'm all ears.

Thank you!

3 Replies

MK Muneesh Kumar G Syncfusion Team February 11, 2019 03:56 AM

Hi Joe, 
Greetings from Syncfusion. 
We have prepared a sample to replicate the issue based on the provided procedure, but we are afraid, that we are not able to reproduce the issue at our end. The sample we tried can be downloaded from the below location. 
Since we are not aware of your exact application scenario we were not able to reproduce this at our end, can you please revert us by modifying the sample based on your application along with replication procedure. This will be helpful for us to provide you better solution at the earliest.   
Muneesh Kumar G. 

MC Matt Carroll February 11, 2019 09:42 AM

The difference is that I need a new Loaded callback for each chart generated, and I'm not certain how many charts there will be. I'll try using reflection to create a new callback for each chart and bump this thread if it doesn't work out.

MK Muneesh Kumar G Syncfusion Team February 12, 2019 03:55 AM

Hi Joe 
Thanks for your update and we will wait to hear from you. 
Muneesh Kumar G. 

Live Chat Icon For mobile
Up arrow icon