mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-23 17:30:10 +00:00
修复Legend的formatter设置为固定值时显示不正常的问题
This commit is contained in:
@@ -55,6 +55,7 @@ namespace XCharts.Runtime
|
||||
chart.chartMaxAnchor, chart.chartPivot, chart.chartSizeDelta);
|
||||
legend.gameObject = legendObject;
|
||||
legendObject.hideFlags = chart.chartHideFlags;
|
||||
//ChartHelper.DestoryGameObjectByMatch(legendObject.transform, "_");
|
||||
SeriesHelper.UpdateSerieNameList(chart, ref chart.m_LegendRealShowName);
|
||||
legend.context.background = ChartHelper.AddIcon("background", legendObject.transform, 0, 0);
|
||||
legend.context.background.transform.SetSiblingIndex(0);
|
||||
@@ -85,13 +86,14 @@ namespace XCharts.Runtime
|
||||
for (int i = 0; i < datas.Count; i++)
|
||||
{
|
||||
if (!SeriesHelper.IsLegalLegendName(datas[i])) continue;
|
||||
string legendName = GetFormatterContent(legend, i, datas[i]);
|
||||
string legendName = datas[i];
|
||||
var legendContent = GetFormatterContent(legend, i, datas[i]);
|
||||
var readIndex = chart.m_LegendRealShowName.IndexOf(datas[i]);
|
||||
var active = chart.IsActiveByLegend(datas[i]);
|
||||
var bgColor = LegendHelper.GetIconColor(chart, legend, readIndex, datas[i], active);
|
||||
bgColor.a = legend.itemOpacity;
|
||||
var item = LegendHelper.AddLegendItem(chart, legend, i, datas[i], legendObject.transform, chart.theme,
|
||||
legendName, bgColor, active, readIndex);
|
||||
legendContent, bgColor, active, readIndex);
|
||||
legend.SetButton(legendName, item, totalLegend);
|
||||
ChartHelper.ClearEventListener(item.button.gameObject);
|
||||
ChartHelper.AddEventListener(item.button.gameObject, EventTriggerType.PointerDown, (data) =>
|
||||
|
||||
Reference in New Issue
Block a user