优化切换主题显示效果

This commit is contained in:
monitor1394
2018-10-02 08:57:47 +08:00
parent a62e856c43
commit f7bfc9c73b
5 changed files with 72 additions and 61 deletions

View File

@@ -3,13 +3,6 @@ using UnityEngine.UI;
namespace xcharts
{
[System.Serializable]
public enum PointType
{
square,
cicle
}
[System.Serializable]
public class LineInfo
{
@@ -17,9 +10,7 @@ namespace xcharts
[Header("Point")]
public bool showPoint = true;
public PointType pointType = PointType.square;
public float pointWid = 1.0f;
public Color pointColor = Color.white;
public float pointWid = 2.5f;
[Header("Smooth")]
public bool smooth = false;
@@ -107,15 +98,15 @@ namespace xcharts
SeriesData data = series.dataList[i];
Vector3 p = new Vector3(startX + i * scaleWid, zeroY + data.value * coordinateHig / max);
switch (lineInfo.pointType)
if(theme == Theme.Dark)
{
case PointType.square:
ChartUtils.DrawPolygon(vh, p, lineInfo.pointWid, lineInfo.pointColor);
break;
case PointType.cicle:
ChartUtils.DrawCricle(vh, p, lineInfo.pointWid, lineInfo.pointColor,
(int)lineInfo.pointWid * 5);
break;
ChartUtils.DrawCricle(vh, p, lineInfo.pointWid, color, (int)lineInfo.pointWid * 5);
}
else
{
ChartUtils.DrawCricle(vh, p, lineInfo.pointWid, Color.white);
ChartUtils.DrawDoughnut(vh, p, lineInfo.pointWid - lineInfo.tickness,
lineInfo.pointWid, 0, 360, color);
}
}
}