mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-18 22:40:10 +00:00
优化切换主题显示效果
This commit is contained in:
@@ -196,6 +196,13 @@ namespace xcharts
|
||||
RefreshChart();
|
||||
}
|
||||
|
||||
public void UpdateTheme(Theme theme)
|
||||
{
|
||||
this.theme = theme;
|
||||
OnThemeChanged();
|
||||
SetAllDirty();
|
||||
}
|
||||
|
||||
protected void HideChild(string match = null)
|
||||
{
|
||||
for (int i = 0; i < transform.childCount; i++)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,6 +174,7 @@ namespace xcharts
|
||||
radarInfo.backgroundColorList.Add(ThemeInfo.GetColor("#e7e7e7"));
|
||||
break;
|
||||
}
|
||||
InitIndicator();
|
||||
}
|
||||
|
||||
private void DrawData(VertexHelper vh)
|
||||
|
||||
Reference in New Issue
Block a user