Update LineChart.cs

修复当只有两个数据时区域图绘制异常的问题
This commit is contained in:
monitor1394
2019-09-27 11:06:17 +08:00
committed by GitHub
parent a59723ecef
commit a52fbd023e

View File

@@ -451,11 +451,6 @@ namespace XCharts
dnPos = np + (isDown ? dirDp : -dirDp) * diff;
upPos1 = np + (isDown ? -dir1v : dir1v) * serie.lineStyle.width;
upPos2 = np + (isDown ? -dir2v : dir2v) * serie.lineStyle.width;
if (dataIndex == 1)
{
stPos1 = lp - dir1v * serie.lineStyle.width;
stPos2 = lp + dir1v * serie.lineStyle.width;
}
lastDir = dir1;
}
else
@@ -467,6 +462,11 @@ namespace XCharts
upPos2 = np + dir1v * serie.lineStyle.width;
dnPos = isDown ? upPos2 : upPos1;
}
if (dataIndex == 1)
{
stPos1 = lp - dir1v * serie.lineStyle.width;
stPos2 = lp + dir1v * serie.lineStyle.width;
}
var smoothPoints = serie.GetUpSmoothList(dataIndex);
var smoothDownPoints = serie.GetDownSmoothList(dataIndex);
var dist = Vector3.Distance(lp, np);