mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-07-06 23:03:56 +00:00
[refactor][optimize] item color
This commit is contained in:
@@ -524,5 +524,18 @@ namespace XCharts.Runtime
|
||||
var background = GetChartComponent<Background>();
|
||||
return theme.GetBackgroundColor(background);
|
||||
}
|
||||
|
||||
public Color32 GetItemColor(Serie serie, SerieData serieData, bool highlight = false)
|
||||
{
|
||||
var colorIndex = serieData == null || !serie.useDataNameForColor
|
||||
? GetLegendRealShowNameIndex(serie.legendName)
|
||||
: GetLegendRealShowNameIndex(serieData.legendName);
|
||||
return SerieHelper.GetItemColor(serie, serieData, m_Theme, colorIndex, highlight);
|
||||
}
|
||||
|
||||
public Color32 GetItemColor(Serie serie, bool highlight = false)
|
||||
{
|
||||
return SerieHelper.GetItemColor(serie, null, m_Theme, serie.context.colorIndex, highlight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -402,7 +402,6 @@ namespace XCharts.Runtime
|
||||
m_ChartPivot = m_GraphPivot;
|
||||
m_ChartSizeDelta = m_GraphSizeDelta;
|
||||
m_ChartRect = m_GraphRect;
|
||||
|
||||
SetAllComponentDirty();
|
||||
OnCoordinateChanged();
|
||||
RefreshChart();
|
||||
|
||||
Reference in New Issue
Block a user