3.0 - guage chart

This commit is contained in:
monitor1394
2022-02-19 17:35:22 +08:00
parent a19b796a02
commit ce5aeb2d98
41 changed files with 266 additions and 337 deletions

View File

@@ -1,77 +0,0 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace XCharts
{
[Serializable]
public class GaugeAxisTheme : BaseAxisTheme
{
[SerializeField] private Color32 m_BarBackgroundColor;
[SerializeField]
private List<StageColor> m_StageColor = new List<StageColor>()
{
new StageColor(0.2f,new Color32(145,199,174,255)),
new StageColor(0.8f,new Color32(99,134,158,255)),
new StageColor(1.0f,new Color32(194,53,49,255)),
};
/// <summary>
/// 进度条背景颜色。
/// </summary>
public Color32 barBackgroundColor { get { return m_BarBackgroundColor; } set { m_BarBackgroundColor = value; } }
/// <summary>
/// 阶段颜色。
/// </summary>
public List<StageColor> stageColor { get { return m_StageColor; } set { m_StageColor = value; } }
public GaugeAxisTheme(ThemeType theme) : base(theme)
{
m_LineWidth = XCSettings.gaugeAxisLineWidth;
m_LineLength = 0;
m_SplitLineWidth = XCSettings.gaugeAxisSplitLineWidth;
m_SplitLineLength = XCSettings.gaugeAxisSplitLineLength;
m_TickWidth = XCSettings.gaugeAxisTickWidth;
m_TickLength = XCSettings.gaugeAxisTickLength;
m_SplitLineColor = Color.white;
m_TickColor = Color.white;
switch (theme)
{
case ThemeType.Default:
m_BarBackgroundColor = new Color32(200, 200, 200, 255);
m_StageColor = new List<StageColor>()
{
new StageColor(0.2f,new Color32(145,199,174,255)),
new StageColor(0.8f,new Color32(99,134,158,255)),
new StageColor(1.0f,new Color32(194,53,49,255)),
};
break;
case ThemeType.Light:
m_BarBackgroundColor = new Color32(200, 200, 200, 255);
m_StageColor = new List<StageColor>()
{
new StageColor(0.2f,new Color32(145,199,174,255)),
new StageColor(0.8f,new Color32(99,134,158,255)),
new StageColor(1.0f,new Color32(194,53,49,255)),
};
break;
case ThemeType.Dark:
m_BarBackgroundColor = new Color32(200, 200, 200, 255);
m_StageColor = new List<StageColor>()
{
new StageColor(0.2f,new Color32(145,199,174,255)),
new StageColor(0.8f,new Color32(99,134,158,255)),
new StageColor(1.0f,new Color32(194,53,49,255)),
};
break;
}
}
public void Copy(GaugeAxisTheme theme)
{
base.Copy(theme);
m_BarBackgroundColor = theme.barBackgroundColor;
ChartHelper.CopyList(m_StageColor, theme.stageColor);
}
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: b38e4b45ec20b4c65a6dc82891c5c39a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -37,7 +37,6 @@ namespace XCharts
[SerializeField] private SubTitleTheme m_SubTitle;
[SerializeField] private LegendTheme m_Legend;
[SerializeField] private AxisTheme m_Axis;
[SerializeField] private GaugeAxisTheme m_Gauge;
[SerializeField] private TooltipTheme m_Tooltip;
[SerializeField] private DataZoomTheme m_DataZoom;
[SerializeField] private VisualMapTheme m_VisualMap;
@@ -88,7 +87,6 @@ namespace XCharts
public SubTitleTheme subTitle { get { return m_SubTitle; } set { m_SubTitle = value; } }
public LegendTheme legend { get { return m_Legend; } set { m_Legend = value; } }
public AxisTheme axis { get { return m_Axis; } set { m_Axis = value; } }
public GaugeAxisTheme gauge { get { return m_Gauge; } set { m_Gauge = value; } }
public TooltipTheme tooltip { get { return m_Tooltip; } set { m_Tooltip = value; } }
public DataZoomTheme dataZoom { get { return m_DataZoom; } set { m_DataZoom = value; } }
public VisualMapTheme visualMap { get { return m_VisualMap; } set { m_VisualMap = value; } }
@@ -235,7 +233,6 @@ namespace XCharts
m_Title.Copy(theme.title);
m_SubTitle.Copy(theme.subTitle);
m_Axis.Copy(theme.axis);
m_Gauge.Copy(theme.gauge);
m_Tooltip.Copy(theme.tooltip);
m_DataZoom.Copy(theme.dataZoom);
m_VisualMap.Copy(theme.visualMap);
@@ -344,7 +341,6 @@ namespace XCharts
subTitle.font = font;
legend.font = font;
axis.font = font;
gauge.font = font;
tooltip.font = font;
dataZoom.font = font;
visualMap.font = font;
@@ -372,7 +368,6 @@ namespace XCharts
theme.subTitle = new SubTitleTheme(theme.themeType);
theme.legend = new LegendTheme(theme.themeType);
theme.axis = new AxisTheme(theme.themeType);
theme.gauge = new GaugeAxisTheme(theme.themeType);
theme.tooltip = new TooltipTheme(theme.themeType);
theme.dataZoom = new DataZoomTheme(theme.themeType);
theme.visualMap = new VisualMapTheme(theme.themeType);

View File

@@ -112,7 +112,6 @@ namespace XCharts
public SubTitleTheme subTitle { get { return sharedTheme.subTitle; } }
public LegendTheme legend { get { return sharedTheme.legend; } }
public AxisTheme axis { get { return sharedTheme.axis; } }
public GaugeAxisTheme gauge { get { return sharedTheme.gauge; } }
public TooltipTheme tooltip { get { return sharedTheme.tooltip; } }
public DataZoomTheme dataZoom { get { return sharedTheme.dataZoom; } }
public VisualMapTheme visualMap { get { return sharedTheme.visualMap; } }