增加PieLabelLine支持Symbol

This commit is contained in:
monitor1394
2022-11-14 21:49:53 +08:00
parent 8c0eb970d3
commit 8a7f0c6533
3 changed files with 21 additions and 15 deletions

View File

@@ -516,6 +516,7 @@ namespace XCharts.Runtime
break;
}
}
DrawLabelLineSymbol(vh, labelLine, pos1, pos5, color);
}
}

View File

@@ -407,22 +407,8 @@ namespace XCharts.Runtime
UGL.DrawLine(vh, pos1, pos5, labelLine.lineWidth, color);
break;
}
if (labelLine.startSymbol != null && labelLine.startSymbol.show)
{
DrawSymbol(vh, labelLine.startSymbol, pos1, color);
}
if (labelLine.endSymbol != null && labelLine.endSymbol.show)
{
DrawSymbol(vh, labelLine.endSymbol, pos5, color);
}
DrawLabelLineSymbol(vh, labelLine, pos1, pos5, color);
}
}
private void DrawSymbol(VertexHelper vh, SymbolStyle symbol, Vector3 pos, Color32 defaultColor)
{
var color = symbol.GetColor(defaultColor);
chart.DrawSymbol(vh, symbol.type, symbol.size, 1, pos,
color, color, ColorUtil.clearColor32, color, symbol.gap, null);
}
}
}

View File

@@ -593,5 +593,24 @@ namespace XCharts.Runtime
paramList.Add(param);
}
public void DrawLabelLineSymbol(VertexHelper vh, LabelLine labelLine, Vector3 startPos, Vector3 endPos, Color32 defaultColor)
{
if (labelLine.startSymbol != null && labelLine.startSymbol.show)
{
DrawSymbol(vh, labelLine.startSymbol, startPos, defaultColor);
}
if (labelLine.endSymbol != null && labelLine.endSymbol.show)
{
DrawSymbol(vh, labelLine.endSymbol, endPos, defaultColor);
}
}
private void DrawSymbol(VertexHelper vh, SymbolStyle symbol, Vector3 pos, Color32 defaultColor)
{
var color = symbol.GetColor(defaultColor);
chart.DrawSymbol(vh, symbol.type, symbol.size, 1, pos,
color, color, ColorUtil.clearColor32, color, symbol.gap, null);
}
}
}