[feature][bug] fix import packge error

This commit is contained in:
monitor1394
2022-07-29 13:25:05 +08:00
parent 74b078c926
commit b9812a4f98
3 changed files with 11 additions and 3 deletions

View File

@@ -56,9 +56,16 @@ namespace XCharts.Runtime
{
if (!XChartsMgr.themes.ContainsKey(themeName))
{
return null;
ReloadThemeList();
if (XChartsMgr.themes.ContainsKey(themeName))
return XChartsMgr.themes[themeName];
else
return null;
}
else
{
return XChartsMgr.themes[themeName];
}
return XChartsMgr.themes[themeName];
}
public static Theme LoadTheme(ThemeType type)

View File

@@ -282,7 +282,7 @@ namespace XCharts.Runtime
public static void GetItemColor(out Color32 color, out Color32 toColor,
Serie serie, SerieData serieData, ThemeStyle theme, SerieState state = SerieState.Auto)
{
var colorIndex = serie.colorByData? serieData.index : serie.context.colorIndex;
var colorIndex = serieData != null && serie.colorByData? serieData.index : serie.context.colorIndex;
GetItemColor(out color, out toColor, serie, serieData, theme, colorIndex, state, true);
}