[optimize][legend] support background and padding

This commit is contained in:
monitor1394
2022-06-24 22:15:49 +08:00
parent 8a6253621b
commit 7c07499e44
4 changed files with 56 additions and 0 deletions

View File

@@ -56,6 +56,9 @@ namespace XCharts.Runtime
legend.gameObject = legendObject;
legendObject.hideFlags = chart.chartHideFlags;
SeriesHelper.UpdateSerieNameList(chart, ref chart.m_LegendRealShowName);
legend.context.background = ChartHelper.AddIcon("background", legendObject.transform, 0, 0);
legend.context.background.transform.SetSiblingIndex(0);
ChartHelper.SetBackground(legend.context.background, legend.background);
List<string> datas;
if (legend.show && legend.data.Count > 0)
{