Syncfusion Blazor Chart Export Fails with Gradient Fill (NullReferenceException in Visual Studio, No Error in Playground)
Description
When exporting a Syncfusion Blazor Range Chart with a gradient fill (using `Fill="url(#gradient1)"`), the export does not work.
No image is produced, and a `NullReferenceException` is thrown during export while running locally in Visually studio but there's no error shown in online blazor playground.
In either case, the export doesn't work (no image is shown after export).
Runnable Minimal Repro:
https://blazorplayground.syncfusion.com/VXrSNFiocSAaiDuJ
Steps to Reproduce:
1. Render the chart and click "Export Chart as PNG".
2. In Visual Studio, a `NullReferenceException` is thrown and no image is produced.
3. In the Syncfusion Blazor Playground, no error is thrown, but the export still doesn't work.
Expected:
Export should succeed and show the full chart with the gradient fill.
Request:
Please help resolve the export issue so that charts with gradient fills can be exported as PNG (and SVG) without errors.
Thank you.
Repro code (for future reference):
Hi Ashish,
We’ve reviewed the issue you reported in both Visual Studio and the Playground environment. In Visual Studio, we were unable to reproduce the ‘NullReferenceException’ during chart export. For your reference, we’ve attached a sample project using your shared code snippet along with a screenshot.
Screenshot :
Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/PNGGradient.zip
We have resolved the problem faced in playground while displaying the base64 string as an image. kindly check with the below link.
Playground Sample : https://blazorplayground.syncfusion.com/VXrSNFiocSAaiDuJ
If you are still facing problem, please share the video demonstrating the reported problem in VS so that it will be helpful for us to analyze further and assist you better. Please let us know if you have any concerns.
Regards,
Durga Gopalakrishnan.
This solution is what worked for me:
Syncfusion Blazor Chart Export Fails ... | Blazor Forums | Syncfusion®
Most welcome. Please get back to us if you need any further assistance. We are always happy in assisting you.
- 4 Replies
- 2 Participants
-
AK Ashish Khanal
- Aug 15, 2025 08:59 PM UTC
- Aug 25, 2025 07:27 AM UTC