Skip to content

Commit

Permalink
fix null
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Apr 23, 2024
1 parent f6cc5ab commit 8408a18
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions NewLife.CubeNC/Charts/ECharts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class ECharts : IExtend
public DataZoom[] DataZoom { get; set; }

/// <summary>系列数据</summary>
public IList<Series> Series { get; set; }
public IList<Series> Series { get; set; } = [];

/// <summary>标记的图形。设置后添加的图形都使用该值</summary>
[ScriptIgnore]
Expand All @@ -70,8 +70,6 @@ public class ECharts : IExtend
/// <param name="series"></param>
public void Add(Series series)
{
Series ??= new List<Series>();

Series.Add(series);
}

Expand Down Expand Up @@ -384,7 +382,7 @@ public String Build()

// 提示
var legend = Legend;
legend ??= Series.Select(e => e.Name).ToArray();
legend ??= Series?.Select(e => e.Name).ToArray();
if (legend != null)
{
if (legend is String str)
Expand Down

0 comments on commit 8408a18

Please sign in to comment.