apexcharts / Blazor-ApexCharts

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

Feature Request: include Js files in a more Blazor like way #317

Closed wolfgangschneider closed 10 months ago

wolfgangschneider commented 10 months ago

If its possible with your design it would be nice include the .js files in a more Blazor like style. In my opinion a component should be used in the most simple way:

joadan commented 10 months ago

Hello,

Yes, I agree that would be great. If you feel up to it PR's are more then welcome.

wolfgangschneider commented 10 months ago

Hi

Unfortunately my JS skills are to less to understand the js code.

I was able to load the blazor-apex-charts as module , It able to call “await JSHandler.RenderChartAsync();” that function also worhed well till “chart = new ApexCharts(container, options);” this function goeas deep into the “apexcharts.js” filt , (it still is includes l with the html scriopt tag. And throws an exception chart not defined.

Wolfgang

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows

From: Joakim @.> Sent: Friday, 27 October 2023 10:23 To: @.> Cc: @.>; @.> Subject: Re: [apexcharts/Blazor-ApexCharts] Feature Request: include Js files in a more Blazor like way (Issue #317)

Hello,

Yes, I agree that would be great. If you feel up to it PR's are more then welcome.

— Reply to this email directly, view it on GitHubhttps://github.com/apexcharts/Blazor-ApexCharts/issues/317#issuecomment-1782504163, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADXZ5WQACJYA3ALMYMUFAALYBNVOVAVCNFSM6AAAAAA6SNOR5CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBSGUYDIMJWGM. You are receiving this because you authored the thread.Message ID: @.***>

wolfgangschneider commented 10 months ago

Hi - I made some changes but I am to stupid to Pull the changes (please advice me) Anyhow here are the changes files

Blazor-ApexCharts-changes.zip

And of course remove bothscript Tags form _host.schtml and Indexhtml

joadan commented 10 months ago

321

joadan commented 10 months ago

Thank you for the pull request! It's now merged.

joadan commented 10 months ago

Hmm looks like there is a problem https://apexcharts.github.io/Blazor-ApexCharts/events/brush-scrolled

joadan commented 10 months ago

I guess this is related, https://github.com/apexcharts/apexcharts.js/issues/2315

joadan commented 10 months ago

I added window.ApexCharts = ApexCharts and it seems to be working

joadan commented 10 months ago

Fixed in v2.0.0