apexcharts / Blazor-ApexCharts

A blazor wrapper for ApexCharts.js
https://apexcharts.github.io/Blazor-ApexCharts
MIT License
828 stars 94 forks source link

Blazor Hybrid Export Callbacks #502

Open thirstyape opened 2 months ago

thirstyape commented 2 months ago

In certain Blazor Hybrid scenarios, such as MAUI on Android, downloading files via JavaScript is either not possible or not easy. This means the Export to SVG, PNG, and CSV options may not work.

My suggestion is to add a custom exporter callback that simply has a JavaScript invoked function that will relay the export information back to C# so the user can handle the export. In the case of .NET MAUI this could easily be linked to something such as FileSaver from the .NET MAUI Community Toolkit.

Getting the data should be possible as per this GitHub Issue.

Just opening for discussion and reference right now; I will create a PR in about one month.

joadan commented 2 months ago

Hi,

Sounds good, looking forward for the PR.