mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-30 05:08:48 +00:00
增加雷达图区域显示参数设置
This commit is contained in:
@@ -14,6 +14,7 @@ namespace xcharts
|
|||||||
[System.Serializable]
|
[System.Serializable]
|
||||||
public class RadarInfo
|
public class RadarInfo
|
||||||
{
|
{
|
||||||
|
public bool area;
|
||||||
public float radius = 100;
|
public float radius = 100;
|
||||||
public int splitNumber = 5;
|
public int splitNumber = 5;
|
||||||
|
|
||||||
@@ -159,6 +160,7 @@ namespace xcharts
|
|||||||
if (!legend.IsShowSeries(i)) continue;
|
if (!legend.IsShowSeries(i)) continue;
|
||||||
var dataList = seriesList[i].dataList;
|
var dataList = seriesList[i].dataList;
|
||||||
var color = legend.GetColor(i);
|
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 ?
|
var max = radarInfo.indicatorList[i].max > 0 ?
|
||||||
radarInfo.indicatorList[i].max :
|
radarInfo.indicatorList[i].max :
|
||||||
GetMaxValue();
|
GetMaxValue();
|
||||||
@@ -177,11 +179,13 @@ namespace xcharts
|
|||||||
{
|
{
|
||||||
toPoint = new Vector3(p.x + radius * Mathf.Sin(currAngle),
|
toPoint = new Vector3(p.x + radius * Mathf.Sin(currAngle),
|
||||||
p.y + radius * Mathf.Cos(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);
|
ChartUtils.DrawLine(vh, startPoint, toPoint, radarInfo.lineTickness, color);
|
||||||
startPoint = toPoint;
|
startPoint = toPoint;
|
||||||
}
|
}
|
||||||
pointList.Add(startPoint);
|
pointList.Add(startPoint);
|
||||||
}
|
}
|
||||||
|
if (radarInfo.area) ChartUtils.DrawTriangle(vh, p, startPoint, firstPoint, areaColor);
|
||||||
ChartUtils.DrawLine(vh, startPoint, firstPoint, radarInfo.lineTickness, color);
|
ChartUtils.DrawLine(vh, startPoint, firstPoint, radarInfo.lineTickness, color);
|
||||||
foreach (var point in pointList)
|
foreach (var point in pointList)
|
||||||
{
|
{
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user