diff --git a/docs/BlazorApexCharts.Docs/Components/ChartService/Usage.razor b/docs/BlazorApexCharts.Docs/Components/ChartService/Usage.razor index 2b4dba9a..f486898d 100644 --- a/docs/BlazorApexCharts.Docs/Components/ChartService/Usage.razor +++ b/docs/BlazorApexCharts.Docs/Components/ChartService/Usage.razor @@ -37,10 +37,11 @@ Resolve the service /// /// Manually load the required javascript modules + /// and set not initialized global options /// - /// + /// /// - Task LoadJavascriptAsync(string path = null); + Task InitalizeChartAsync(string javascriptPath = null); /// diff --git a/docs/BlazorApexCharts.Docs/Shared/GlobalOptions.razor b/docs/BlazorApexCharts.Docs/Shared/GlobalOptions.razor index 8ee0132b..b8d41da2 100644 --- a/docs/BlazorApexCharts.Docs/Shared/GlobalOptions.razor +++ b/docs/BlazorApexCharts.Docs/Shared/GlobalOptions.razor @@ -1,5 +1,5 @@  - +

This is an example of using the ApexchartService to set global chart options

diff --git a/src/Blazor-ApexCharts/ChartService/ApexChartService.cs b/src/Blazor-ApexCharts/ChartService/ApexChartService.cs index 76f92061..5cfd4b12 100644 --- a/src/Blazor-ApexCharts/ChartService/ApexChartService.cs +++ b/src/Blazor-ApexCharts/ChartService/ApexChartService.cs @@ -128,10 +128,14 @@ public async Task SetLocaleAsync(ChartLocale locale, bool reRenderCharts) await SetGlobalOptionsAsync(globalOptions, reRenderCharts); } + + + /// - public async Task LoadJavascriptAsync(string path = null) + public async Task InitalizeChartAsync(string javascriptPath = null) { - await JSLoader.LoadAsync(jSRuntime, path); + await JSLoader.LoadAsync(jSRuntime, javascriptPath); + await GlobalOptionsInitializedAsync(); } /// diff --git a/src/Blazor-ApexCharts/ChartService/IApexChartService.cs b/src/Blazor-ApexCharts/ChartService/IApexChartService.cs index 68f0d2dc..d925c2a6 100644 --- a/src/Blazor-ApexCharts/ChartService/IApexChartService.cs +++ b/src/Blazor-ApexCharts/ChartService/IApexChartService.cs @@ -25,10 +25,11 @@ public interface IApexChartService /// /// Manually load the required javascript modules + /// and set not initialized global options /// - /// + /// /// - Task LoadJavascriptAsync(string path = null); + Task InitalizeChartAsync(string javascriptPath = null); ///