示例#1
0
        protected override async Task OnAfterRenderAsync(bool firstRender)
        {
            if (AutoRender == false)
            {
                return;
            }
            if (firstRender)
            {
                if (option == null && string.IsNullOrWhiteSpace(optionRaw))
                {
                    return;
                }

                if (!string.IsNullOrWhiteSpace(optionRaw))
                {
                    await JsInterop.SetupChart(Id, Theme, optionRaw);
                }
                else
                {
                    await JsInterop.SetupChart(Id, Theme, option);
                }

                if (OnRenderCompleted != null)
                {
                    await OnRenderCompleted(this);
                }
            }
            RequireRender = false;
        }
示例#2
0
        protected override async Task OnAfterRenderAsync(bool firstRender)
        {
            if (AutoRender == false)
            {
                return;
            }
            if (firstRender)
            {
                if (option == null && string.IsNullOrWhiteSpace(optionRaw))
                {
                    return;
                }

                if (!string.IsNullOrWhiteSpace(optionRaw))
                {
                    await JsInterop.SetupChart(Id, Theme, optionRaw);
                }
                else
                {
                    await JsInterop.SetupChart(Id, Theme, option);
                }

                // 事件
                if (EventTypes.Count > 0 && OnEventCallback.HasDelegate)
                {
                    foreach (var eventType in EventTypes)
                    {
                        await JsInterop.ChartOn(Id, eventType, DotNetObjectReference.Create(_eventInvokeHelper));
                    }
                }

                if (OnRenderCompleted != null)
                {
                    await OnRenderCompleted(this);
                }
            }
            RequireRender = false;
        }
示例#3
0
 public async Task SetupOptionAsync(EChartsOption <T> opt, bool notMerge = false)
 {
     await JsInterop.SetupChart(Id, Theme, opt, notMerge);
 }