Fixed markline label refresh when serie hide #178

This commit is contained in:
monitor1394
2021-12-17 21:27:14 +08:00
parent 9d8dc80494
commit 76f640f64d
3 changed files with 9 additions and 6 deletions

View File

@@ -41,6 +41,7 @@
## branch-2.0 ## branch-2.0
* (2021.12.17) Fixed `MarkLine` does not auto refresh label active when serie hide #178
* (2021.12.10) Improved `Radar`'s `AxisLine` and `SplitLine` to be controlled separately * (2021.12.10) Improved `Radar`'s `AxisLine` and `SplitLine` to be controlled separately
* (2021.12.08) Fixed y axis does not refresh when serie hidden * (2021.12.08) Fixed y axis does not refresh when serie hidden
* (2021.12.04) Added `Symbol` new types: `EmptyRect`, `EmptyTriangle`, `EmptyDiamond` * (2021.12.04) Added `Symbol` new types: `EmptyRect`, `EmptyTriangle`, `EmptyDiamond`

View File

@@ -41,6 +41,7 @@
## branch-2.0 ## branch-2.0
* (2021.12.17) 修复`MarkLine`在运行时`Label`不自动刷新显示隐藏的问题 #178
* (2021.12.10) 完善`Radar``AxisLine``SplitLine`可单独控制 * (2021.12.10) 完善`Radar``AxisLine``SplitLine`可单独控制
* (2021.12.08) 修复`Serie`隐藏后`Y`轴最大值不刷新的问题 * (2021.12.08) 修复`Serie`隐藏后`Y`轴最大值不刷新的问题
* (2021.12.04) 增加`Symbol`新类型:`EmptyRect`,`EmptyTriangle`,`EmptyDiamond` * (2021.12.04) 增加`Symbol`新类型:`EmptyRect`,`EmptyTriangle`,`EmptyDiamond`

View File

@@ -309,15 +309,16 @@ namespace XCharts
public void Update() public void Update()
{ {
if (m_RefreshLabel) foreach (var serie in chart.series.list)
{ {
m_RefreshLabel = false; var show = serie.show && serie.markLine.show;
foreach (var serie in chart.series.list) foreach (var data in serie.markLine.data)
{ {
if (!serie.show || !serie.markLine.show) continue; if (data.runtimeLabel != null)
foreach (var data in serie.markLine.data)
{ {
if (data.runtimeLabel != null) if (data.runtimeLabel.gameObject.activeSelf != show)
data.runtimeLabel.gameObject.SetActive(show);
if (show)
{ {
data.runtimeLabel.SetPosition(MarkLineHelper.GetLabelPosition(data)); data.runtimeLabel.SetPosition(MarkLineHelper.GetLabelPosition(data));
data.runtimeLabel.SetText(MarkLineHelper.GetFormatterContent(serie, data)); data.runtimeLabel.SetText(MarkLineHelper.GetFormatterContent(serie, data));