Exemple #1
0
        /// <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);
            }
        }
Exemple #2
0
        /// <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());
            }
        }
Exemple #3
0
    /// <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);
            }
        }
    }
Exemple #4
0
    /// <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);
        }
    }