diff --git a/docs/BlazorApexCharts.Docs.Server/Startup.cs b/docs/BlazorApexCharts.Docs.Server/Startup.cs index 938b8437..03ea1f08 100644 --- a/docs/BlazorApexCharts.Docs.Server/Startup.cs +++ b/docs/BlazorApexCharts.Docs.Server/Startup.cs @@ -26,14 +26,7 @@ public void ConfigureServices(IServiceCollection services) services.AddDocs(); services.AddScoped(); - services.AddApexCharts(e => - { - e.GlobalOptions = new ApexChartBaseOptions - { - Debug = true, - Theme = new Theme { Palette = PaletteType.Palette6 } - }; - }); + services.AddApexCharts(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. diff --git a/src/Blazor-ApexCharts/ApexChart.razor.cs b/src/Blazor-ApexCharts/ApexChart.razor.cs index d1c5fb27..09c97606 100644 --- a/src/Blazor-ApexCharts/ApexChart.razor.cs +++ b/src/Blazor-ApexCharts/ApexChart.razor.cs @@ -425,7 +425,11 @@ protected override async Task OnAfterRenderAsync(bool firstRender) isReady = true; JSHandler = new JSHandler(this); - await chartService?.GlobalOptionsInitializedAsync(); + if (chartService != null) + { + await chartService.GlobalOptionsInitializedAsync(); + } + } if (isReady && forceRender)