修复SerieLabel在点击图例隐藏Serie后还显示的问题#94

This commit is contained in:
monitor1394
2020-09-18 22:00:03 +08:00
parent e10f36ff8c
commit 166a94012d
3 changed files with 8 additions and 1 deletions

View File

@@ -1498,9 +1498,13 @@ namespace XCharts
var isPercentStack = SeriesHelper.IsPercentStack(m_Series, serie.stack, SerieType.Bar);
for (int j = 0; j < serie.data.Count; j++)
{
if (j >= serie.dataPoints.Count) break;
var serieData = serie.data[j];
if (serieData.labelObject == null) continue;
if (j >= serie.dataPoints.Count)
{
serieData.SetLabelActive(false);
continue;
}
var pos = serie.dataPoints[j];
var serieLabel = SerieHelper.GetSerieLabel(serie, serieData);
var dimension = 1;
@@ -1539,6 +1543,7 @@ namespace XCharts
}
else
{
Debug.LogError("lable not show:" + i + "," + j);
serieData.SetLabelActive(false);
}
}