mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-17 22:10:11 +00:00
增加Pie的LabelLine支持Symbol
This commit is contained in:
@@ -516,6 +516,7 @@ namespace XCharts.Runtime
|
||||
break;
|
||||
}
|
||||
}
|
||||
DrawLabelLineSymbol(vh, labelLine, pos1, pos5, color);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user