Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added InitalizeChartAsync #530

Merged
merged 1 commit into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ Resolve the service

/// <summary>
/// Manually load the required javascript modules
/// and set not initialized global options
/// </summary>
/// <param name=""path""></param>
/// <param name=""javascriptPath""></param>
/// <returns></returns>
Task LoadJavascriptAsync(string path = null);
Task InitalizeChartAsync(string javascriptPath = null);


/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion docs/BlazorApexCharts.Docs/Shared/GlobalOptions.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<Alert>
<Alert BackgroundColor="TablerColor.Primary">
<p>This is an example of using the ApexchartService to set global chart options</p>
</Alert>

Expand Down
8 changes: 6 additions & 2 deletions src/Blazor-ApexCharts/ChartService/ApexChartService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,14 @@ public async Task SetLocaleAsync(ChartLocale locale, bool reRenderCharts)
await SetGlobalOptionsAsync(globalOptions, reRenderCharts);
}




/// <inheritdoc/>
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();
}

/// <inheritdoc/>
Expand Down
5 changes: 3 additions & 2 deletions src/Blazor-ApexCharts/ChartService/IApexChartService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ public interface IApexChartService

/// <summary>
/// Manually load the required javascript modules
/// and set not initialized global options
/// </summary>
/// <param name="path"></param>
/// <param name="javascriptPath"></param>
/// <returns></returns>
Task LoadJavascriptAsync(string path = null);
Task InitalizeChartAsync(string javascriptPath = null);


/// <summary>
Expand Down
Loading