优化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

@@ -18,12 +18,14 @@ namespace XCharts
else return (Color)themeInfo.legendUnableColor;
}
public static Color GetIconColor(Legend legend, int readIndex, ThemeInfo themeInfo, bool active)
public static Color GetIconColor(Legend legend, int readIndex, ThemeInfo themeInfo, Series series, string legendName, bool active)
{
if (active)
{
if (legend.itemAutoColor || legend.GetIcon(readIndex) == null)
return (Color)themeInfo.GetColor(readIndex);
{
return SeriesHelper.GetNameColor(series, readIndex, legendName, themeInfo);
}
else
return Color.white;
}