Example #1
0
 /// <inheritdoc />
 protected override async Task OnAfterRenderAsync(bool firstRender)
 {
     if (firstRender)
     {
         await JsRuntime.SetupChart(Config);
         await SetupCompletedCallback.InvokeAsync(this);
     }
     else
     {
         await JsRuntime.UpdateChart(Config);
     }
 }
Example #2
0
 /// <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
 }
Example #3
0
 /// <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());
 }
Example #4
0
 public void Update()
 {
     JsRuntime.UpdateChart(Config);
 }