增加雷达图区域显示参数设置

This commit is contained in:
monitor1394
2018-09-27 06:33:33 +08:00
parent 05bf06d471
commit 34b9b97e76
2 changed files with 1826 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ namespace xcharts
[System.Serializable]
public class RadarInfo
{
public bool area;
public float radius = 100;
public int splitNumber = 5;
@@ -159,6 +160,7 @@ namespace xcharts
if (!legend.IsShowSeries(i)) continue;
var dataList = seriesList[i].dataList;
var color = legend.GetColor(i);
var areaColor = new Color(color.r,color.g,color.b,color.a/2);
var max = radarInfo.indicatorList[i].max > 0 ?
radarInfo.indicatorList[i].max :
GetMaxValue();
@@ -177,11 +179,13 @@ namespace xcharts
{
toPoint = new Vector3(p.x + radius * Mathf.Sin(currAngle),
p.y + radius * Mathf.Cos(currAngle));
if (radarInfo.area) ChartUtils.DrawTriangle(vh, p, startPoint, toPoint, areaColor);
ChartUtils.DrawLine(vh, startPoint, toPoint, radarInfo.lineTickness, color);
startPoint = toPoint;
}
pointList.Add(startPoint);
}
if (radarInfo.area) ChartUtils.DrawTriangle(vh, p, startPoint, firstPoint, areaColor);
ChartUtils.DrawLine(vh, startPoint, firstPoint, radarInfo.lineTickness, color);
foreach (var point in pointList)
{

1822
demo.unity

File diff suppressed because it is too large Load Diff