mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-28 03:58:49 +00:00
修复折线图箭头绘制异常的问题
This commit is contained in:
@@ -59,16 +59,24 @@ namespace XCharts
|
|||||||
if (!serie.show || !serie.lineArrow.show) continue;
|
if (!serie.show || !serie.lineArrow.show) continue;
|
||||||
if (serie.dataPoints.Count < 2) return;
|
if (serie.dataPoints.Count < 2) return;
|
||||||
Color lineColor = SerieHelper.GetLineColor(serie, m_ThemeInfo, n, false);
|
Color lineColor = SerieHelper.GetLineColor(serie, m_ThemeInfo, n, false);
|
||||||
|
Vector3 startPos, arrowPos;
|
||||||
switch (serie.lineArrow.position)
|
switch (serie.lineArrow.position)
|
||||||
{
|
{
|
||||||
case LineArrow.Position.End:
|
case LineArrow.Position.End:
|
||||||
var dataPoints = serie.GetUpSmoothList(serie.dataCount - 1);
|
var dataPoints = serie.GetUpSmoothList(serie.dataCount - 1);
|
||||||
if (dataPoints.Count < 2) dataPoints = serie.dataPoints;
|
if (dataPoints.Count < 3)
|
||||||
var startPos = dataPoints[dataPoints.Count - 2];
|
{
|
||||||
var arrowPos = dataPoints[dataPoints.Count - 1];
|
dataPoints = serie.dataPoints;
|
||||||
|
startPos = dataPoints[dataPoints.Count - 2];
|
||||||
|
arrowPos = dataPoints[dataPoints.Count - 1];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
startPos = dataPoints[dataPoints.Count - 3];
|
||||||
|
arrowPos = dataPoints[dataPoints.Count - 2];
|
||||||
|
}
|
||||||
ChartDrawer.DrawArrow(vh, startPos, arrowPos, serie.lineArrow.width,
|
ChartDrawer.DrawArrow(vh, startPos, arrowPos, serie.lineArrow.width,
|
||||||
serie.lineArrow.height, serie.lineArrow.offset, serie.lineArrow.dent, lineColor);
|
serie.lineArrow.height, serie.lineArrow.offset, serie.lineArrow.dent, lineColor);
|
||||||
break;
|
break;
|
||||||
case LineArrow.Position.Start:
|
case LineArrow.Position.Start:
|
||||||
dataPoints = serie.GetUpSmoothList(1);
|
dataPoints = serie.GetUpSmoothList(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user