diff --git a/src/AntDesign.Charts.Docs/Demos/Bubble/Bubble_Chart.razor b/src/AntDesign.Charts.Docs/Demos/Bubble/Bubble_Chart.razor index 5def47cf..e9010695 100644 --- a/src/AntDesign.Charts.Docs/Demos/Bubble/Bubble_Chart.razor +++ b/src/AntDesign.Charts.Docs/Demos/Bubble/Bubble_Chart.razor @@ -6,21 +6,10 @@ - @* *@ - @* *@ - @* *@ - @* - 示例3 - - - + + + - - 示例4 - - - - *@ 动手实验 diff --git a/src/AntDesign.Charts.Docs/Demos/Bullet/Bullet_Chart.razor b/src/AntDesign.Charts.Docs/Demos/Bullet/Bullet_Chart.razor index 9453622e..c045170f 100644 --- a/src/AntDesign.Charts.Docs/Demos/Bullet/Bullet_Chart.razor +++ b/src/AntDesign.Charts.Docs/Demos/Bullet/Bullet_Chart.razor @@ -43,15 +43,19 @@ BulletConfig config1 = new BulletConfig() { Data = new BulletViewConfigData[] -{ + { new BulletViewConfigData() { - Title = "满意度", - Measures = new int[]{83 }, - Targets = new int[]{90 }, - }, + Title = "满意度", + Measures = new int[]{83 }, + Targets = new int[]{90 }, + Ranges = new double[]{100}, }, - RangeMax = 100, + }, + TargetField = "target", + RangeField = "ranges", + MeasureField = "measures", + XField = "title" }; @@ -136,7 +140,10 @@ Ranges = new double[] {0,0.6,0.9,1}, }, }, - RangeMax = 100, + TargetField = "target", + RangeField = "ranges", + MeasureField = "measures", + XField = "title", RangeColors = new string[] { "#FFB1AC", "#FFDBA2", "#B4EBBF" }, diff --git a/src/AntDesign.Charts.Docs/Demos/Violin/Violin_Chart.razor b/src/AntDesign.Charts.Docs/Demos/Violin/Violin_Chart.razor index 5cea6593..b4288c02 100644 --- a/src/AntDesign.Charts.Docs/Demos/Violin/Violin_Chart.razor +++ b/src/AntDesign.Charts.Docs/Demos/Violin/Violin_Chart.razor @@ -5,16 +5,16 @@ - + - + - + - + @@ -28,16 +28,16 @@ private DynamicExample _example; private object[] Data { get; set; } - protected override void OnAfterRender(bool firstRender) + private async Task onChart1_FirstRender(IChartComponent chart) { - base.OnAfterRender(firstRender); - _example.Chart = Chart; + var data1 = await DemoData.ViolinDataAsync(NavigationManager, HttpClient); + await chart.ChangeData(data1); } - protected override async Task OnInitializedAsync() + protected override void OnAfterRender(bool firstRender) { - Data = await DemoData.ViolinDataAsync(NavigationManager, HttpClient); - await base.OnInitializedAsync(); + base.OnAfterRender(firstRender); + _example.Chart = Chart; } #region Basic violin plot diff --git a/src/AntDesign.Charts/Components/Base/ChartComponentBase.cs b/src/AntDesign.Charts/Components/Base/ChartComponentBase.cs index 9269c4d9..d4b3c8d1 100644 --- a/src/AntDesign.Charts/Components/Base/ChartComponentBase.cs +++ b/src/AntDesign.Charts/Components/Base/ChartComponentBase.cs @@ -285,10 +285,10 @@ public async Task AfterChartRender() { IsCreated = true; - if (Data != null) - { - await JS.InvokeVoidAsync(InteropChangeData, Ref.Id, Data, true); - } + //if (Data != null) + //{ + // await JS.InvokeVoidAsync(InteropChangeData, Ref.Id, Data, true); + //} if (OnCreateAfter.HasDelegate) await OnCreateAfter.InvokeAsync(this); diff --git a/src/AntDesign.Charts/Components/Plots/Bullet/BulletConfig.cs b/src/AntDesign.Charts/Components/Plots/Bullet/BulletConfig.cs index a19ae533..88b60d46 100644 --- a/src/AntDesign.Charts/Components/Plots/Bullet/BulletConfig.cs +++ b/src/AntDesign.Charts/Components/Plots/Bullet/BulletConfig.cs @@ -103,6 +103,15 @@ public class BulletConfig : IBulletViewConfig, IPlotConfig public int? AppendPadding { get; set; } [JsonPropertyName("autoFit")] public bool? AutoFit { get; set; } + + [JsonPropertyName("targetField")] + public string TargetField { get; set; } + + [JsonPropertyName("rangeField")] + public string RangeField { get; set; } + + [JsonPropertyName("measureField")] + public string MeasureField { get; set; } } public interface IBulletViewConfig : IViewConfig @@ -163,7 +172,7 @@ public class BulletViewConfigData /// /// 目标值,array类型。支持多目标设置 /// - [JsonPropertyName("targets")] + [JsonPropertyName("target")] public int[] Targets { get; set; } [JsonPropertyName("markerStyle")]