/// <inheritdoc /> protected override async Task OnAfterRenderAsync(bool firstRender) { if (firstRender) { await JsRuntime.SetupChart(Config); await SetupCompletedCallback.InvokeAsync(this); } else { await JsRuntime.UpdateChart(Config); } }
/// <inheritdoc /> protected override Task OnAfterRenderAsync(bool firstRender) { try { return(firstRender ? JsRuntime.SetupChart(Config).AsTask() : JsRuntime.UpdateChart(Config).AsTask()); } catch (Exception e) { Console.Error.WriteLine($"Error while {(firstRender ? "setting up" : "updating")} the chart. Message: {e.StackTrace}"); return(Task.CompletedTask); } // https://github.com/aspnet/AspNetCore/issues/8327 }
/// <summary> /// Updates the chart. /// /// <para>Call this method after you've changed something in the chart#s configuration</para> /// </summary> /// <returns></returns> public Task Update() { return(JsRuntime.UpdateChart(Config).AsTask()); }
public void Update() { JsRuntime.UpdateChart(Config); }