优化Legend的颜色可自动匹配ItemStyle的自定义颜色#89

This commit is contained in:
monitor1394
2020-09-08 09:28:19 +08:00
parent c01493bcaa
commit d65209ced5
6 changed files with 44 additions and 4 deletions

View File

@@ -364,7 +364,7 @@ namespace XCharts
string legendName = m_Legend.GetFormatterContent(datas[i]);
var readIndex = m_LegendRealShowName.IndexOf(datas[i]);
var active = IsActiveByLegend(datas[i]);
var bgColor = LegendHelper.GetIconColor(m_Legend, readIndex, themeInfo, active);
var bgColor = LegendHelper.GetIconColor(m_Legend, readIndex, themeInfo, m_Series, datas[i], active);
var item = LegendHelper.AddLegendItem(m_Legend, i, datas[i], legendObject.transform, m_ThemeInfo,
legendName, bgColor, active);
m_Legend.SetButton(legendName, item, totalLegend);