Skip to content

Commit

Permalink
增加SerieData可单独添加Label的支持
Browse files Browse the repository at this point in the history
  • Loading branch information
monitor1394 committed Nov 30, 2023
1 parent 0a19b2a commit 735e36d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions Documentation~/zh/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ slug: /changelog

日志详情:

* (2023.11.30) 增加`SerieData`可单独添加`Label`的支持
* (2023.11.28) 修复`Tooltip`在对数轴时指示不准确的问题
* (2023.11.24) 修复`Chart``UpdateData()`接口返回值不准确的问题
* (2023.11.24) 修复`Axis`的更新数据时效果不顺畅的问题
Expand Down
12 changes: 9 additions & 3 deletions Runtime/Serie/SerieHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,9 @@ public static LabelStyle GetSerieLabel(Serie serie, SerieData serieData, SerieSt
else
{
var stateStyle = GetStateStyle(serie, serieData, state);
return stateStyle == null || !stateStyle.show ? serie.label : stateStyle.label;
if (stateStyle != null && stateStyle.show) return stateStyle.label;
else if (serieData.labelStyle != null) return serieData.labelStyle;
else return serie.label;
}
}

Expand All @@ -483,7 +485,9 @@ public static LabelLine GetSerieLabelLine(Serie serie, SerieData serieData, Seri
else
{
var stateStyle = GetStateStyle(serie, serieData, state);
return stateStyle == null || !stateStyle.show ? serie.labelLine : stateStyle.labelLine;
if (stateStyle != null && stateStyle.show) return stateStyle.labelLine;
else if (serieData.labelLine != null) return serieData.labelLine;
else return serie.labelLine;
}
}

Expand All @@ -497,7 +501,9 @@ public static SerieSymbol GetSerieSymbol(Serie serie, SerieData serieData, Serie
else
{
var stateStyle = GetStateStyle(serie, serieData, state);
return stateStyle == null || !stateStyle.show ? serie.symbol : stateStyle.symbol;
if (stateStyle != null && stateStyle.show) return stateStyle.symbol;
else if (serieData.symbol != null) return serieData.symbol;
else return serie.symbol;
}
}

Expand Down

0 comments on commit 735e36d

Please sign in to comment.