/// <summary> /// 更新图表方法 /// </summary> public async Task Update(string method = "") { if (OnInit != null) { var ds = await OnInit.Invoke(); Interop?.Invoke(this, Chart, "chart", nameof(Completed), ds, method, ChartType.ToDescriptionString(), Angle); } }
/// <summary> /// OnAfterRenderAsync 方法 /// </summary> /// <param name="firstRender"></param> protected override async Task OnAfterRenderAsync(bool firstRender) { base.OnAfterRender(firstRender); if (firstRender) { if (OnInit == null) { throw new InvalidOperationException("OnInit paramenter must be set"); } if (Interop == null) { Interop = new JSInterop <ChartBase>(JSRuntime); } var ds = await OnInit.Invoke(); Interop?.Invoke(this, Chart, "chart", nameof(Completed), ds, "", ChartType.ToDescriptionString()); } }
/// <summary> /// 更新图表方法 /// </summary> public async Task Update(ChartAction action) { if (OnInitAsync != null) { var ds = await OnInitAsync(); await Interop.InvokeVoidAsync(this, ChartElement, "bb_chart", nameof(Completed), ds, action.ToDescriptionString(), ChartType.ToDescriptionString(), Angle); if (OnAfterUpdateAsync != null) { await OnAfterUpdateAsync(action); } } }
/// <summary> /// OnAfterRenderAsync 方法 /// </summary> /// <param name="firstRender"></param> protected override async Task OnAfterRenderAsync(bool firstRender) { base.OnAfterRender(firstRender); if (firstRender) { if (OnInitAsync == null) { throw new InvalidOperationException("OnInit paramenter must be set"); } Interop ??= new JSInterop <Chart>(JSRuntime); var ds = await OnInitAsync.Invoke(); await Interop.InvokeVoidAsync(this, ChartElement, "bb_chart", nameof(Completed), ds, "", ChartType.ToDescriptionString(), Angle); } }