修复MarkLine多个时只显示一个Label的问题

This commit is contained in:
monitor1394
2023-08-25 13:22:24 +08:00
parent dc46477c15
commit 32b2137b87
2 changed files with 3 additions and 2 deletions

View File

@@ -73,7 +73,7 @@ namespace XCharts.Runtime
data.painter = chart.m_PainterUpper;
data.refreshComponent = delegate ()
{
var textName = string.Format("markLine_{0}_{1}", serie.index, data.index);
var textName = string.Format("markLine_{0}_{1}", component.index, data.index);
var content = MarkLineHelper.GetFormatterContent(serie, data);
var label = ChartHelper.AddChartLabel(textName, m_MarkLineLabelRoot.transform, data.label, chart.theme.axis,
content, Color.clear, TextAnchor.MiddleCenter);
@@ -154,7 +154,7 @@ namespace XCharts.Runtime
sp = new Vector3(grid.context.x, pY);
ep = new Vector3(grid.context.x + grid.context.width, pY);
}
else if (data.yValue != 0)
else if (data.yValue != 0 || (data.xValue == 0 && data.yValue == 0 && yAxis.IsValue()))
{
data.runtimeValue = data.yValue;
if (yAxis.IsCategory())