using AntDesign.Charts; using Microsoft.AspNetCore.Components; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using wispro.sp.web.Services; namespace wispro.sp.web.Pages.Report { public partial class PieChart { private AntDesign.Charts.IChartComponent chart; private PieConfig config4 = new PieConfig { ForceFit = true, Title = new Title { Visible = true, Text = "Pie Chart-Graphic Tab Spider Layout", AlignTo= "left" }, Description = new Description { Visible = false, Text = "When the type of the pie chart label is set to spider, the labels are divided into two groups, and they are displayed in alignment by pulling lines on both sides of the chart. Generally speaking, the labels of the spider layout are less likely to block each other." }, Radius = 0.8, AngleField = "value", ColorField = "ColumnA", Label = new PieLabelConfig { Visible = true, Type = "spider" } }; private share.ChartDatas Datas=new share.ChartDatas() { Title ="初始化标题", Datas = new List() { new share.ChartData(){ ColumnA ="A",value =1} }, ATitle ="" }; [Inject] ReportService reportService { get; set; } [Obsolete] protected async override Task OnInitializedAsync() { Datas = await reportService.GetAppealReportData(1,DateTime.Parse("2022-02-01"),null,null); if (Datas != null) { config4.Title.Text = Datas.Title; config4.XField = Datas.ATitle; await chart.ChangeData(Datas.Datas); await chart.UpdateChart(config4); StateHasChanged(); } await base.OnInitializedAsync(); } } }