This commit is contained in:
monitor1394
2022-03-26 21:34:38 +08:00
parent 3fbf5bc906
commit ed393ea560
13 changed files with 79 additions and 121 deletions

View File

@@ -21,7 +21,7 @@ namespace XCharts.Runtime
Start
}
[SerializeField] private bool m_Show;
[SerializeField] Position m_Position;
[SerializeField] private Position m_Position;
[SerializeField]
private ArrowStyle m_Arrow = new ArrowStyle()
{

View File

@@ -8,8 +8,7 @@ namespace XCharts.Runtime
/// DataZoom component is used for zooming a specific area,
/// which enables user to investigate data in detail,
/// or get an overview of the data, or get rid of outlier points.
/// |
/// <para>DataZoom 组件 用于区域缩放,从而能自由关注细节的数据信息,或者概览数据整体,或者去除离群点的影响。</para>
/// |DataZoom 组件 用于区域缩放,从而能自由关注细节的数据信息,或者概览数据整体,或者去除离群点的影响。
/// </summary>
[System.Serializable]
[ComponentHandler(typeof(DataZoomHandler), true)]
@@ -132,7 +131,7 @@ namespace XCharts.Runtime
}
/// <summary>
/// Whether built-in support is supported.
/// |Built into the coordinate system to allow the user to zoom in and out of the coordinate system by mouse dragging,
/// Built into the coordinate system to allow the user to zoom in and out of the coordinate system by mouse dragging,
/// mouse wheel, finger swiping (on the touch screen).
/// |是否支持内置。内置于坐标系中,使用户可以在坐标系上通过鼠标拖拽、鼠标滚轮、手指滑动(触屏上)来缩放或漫游坐标系。
/// </summary>
@@ -303,7 +302,7 @@ namespace XCharts.Runtime
}
/// <summary>
/// The end percentage of the window out of the data extent, in the range of 0 ~ 100.
/// 数据窗口范围的结束百分比。范围是0 ~ 100。
/// |数据窗口范围的结束百分比。范围是0 ~ 100。
/// </summary>
public float end
{

View File

@@ -109,26 +109,6 @@ namespace XCharts.Runtime
return SerieHelper.GetItemColor(destSerie, destSerieData, chart.theme, index, false);
}
/// <summary>
/// 同堆叠的serie是否有渐变色的。
/// </summary>
/// <param name="stack"></param>
/// <returns></returns>
public static bool IsAnyGradientSerie(List<Serie> series, string stack)
{
if (string.IsNullOrEmpty(stack)) return false;
foreach (var serie in series)
{
if (serie.show && serie.areaStyle != null && serie.areaStyle.show && stack.Equals(serie.stack))
{
if (!ChartHelper.IsValueEqualsColor(serie.areaStyle.color, serie.areaStyle.toColor)
&& !ChartHelper.IsClearColor(serie.areaStyle.toColor))
return true;
}
}
return false;
}
/// <summary>
/// 是否有需裁剪的serie。
/// </summary>
@@ -142,18 +122,6 @@ namespace XCharts.Runtime
return false;
}
public static bool IsAnyUpdateAnimationSerie(List<Serie> series)
{
foreach (var serie in series)
{
if (serie.animation.enable && serie.animation.dataChangeEnable)
{
return true;
}
}
return false;
}
/// <summary>
/// 获得上一个同堆叠且显示的serie。
/// </summary>
@@ -170,17 +138,6 @@ namespace XCharts.Runtime
return null;
}
/// <summary>
/// 获得上一个同堆叠且显示的serie。
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
public static Serie GetLastStackSerie(List<Serie> series, int index)
{
var serie = series[index];
return GetLastStackSerie(series, serie);
}
public static Serie GetSerieByVesselIndex(List<Serie> series, int vesselIndex)
{
foreach (var serie in series)

View File

@@ -2,17 +2,15 @@
using System.Collections.Generic;
using UnityEngine;
using System;
using System.Text;
namespace XCharts.Runtime
{
[Serializable]
[CreateAssetMenu(menuName = "XCharts/Export Lang")]
/// <summary>
/// Language.
/// |国际化语言表。
/// </summary>
[Serializable]
[CreateAssetMenu(menuName = "XCharts/Export Lang")]
public class Lang : ScriptableObject
{
public string langName = "EN";
@@ -58,6 +56,7 @@ namespace XCharts.Runtime
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
}
[Serializable]
public class LangCandlestick
{
public List<string> dimensionNames = new List<string>() { "open", "close", "lowest", "highest" };

View File

@@ -21,7 +21,8 @@ namespace XCharts.Runtime
public void OnGUI()
{
m_EssentialResourcesImported = File.Exists("Assets/XCharts/Resources/XCSettings.asset");
m_EssentialResourcesImported = Resources.Load<XCSettings>("XCSettings") != null ||
XCSettings.ExistAssetFile();
GUILayout.BeginVertical();
{
@@ -125,17 +126,17 @@ namespace XCharts.Runtime
}
}
public class XChartsPackageResourceImporterWindow : UnityEditor.EditorWindow
public class XCResourceImporterWindow : UnityEditor.EditorWindow
{
[SerializeField] XCResourcesImporter m_ResourceImporter;
static XChartsPackageResourceImporterWindow m_ImporterWindow;
static XCResourceImporterWindow m_ImporterWindow;
public static void ShowPackageImporterWindow()
{
if (m_ImporterWindow == null)
{
m_ImporterWindow = GetWindow<XChartsPackageResourceImporterWindow>();
m_ImporterWindow = GetWindow<XCResourceImporterWindow>();
m_ImporterWindow.titleContent = new GUIContent("XCharts Importer");
}

View File

@@ -129,9 +129,8 @@ namespace XCharts.Runtime
#if UNITY_EDITOR
if (s_Instance == null)
{
var isExist = System.IO.File.Exists("Assets/XCharts/Resources/XCSettings.asset");
if(isExist)
XChartsPackageResourceImporterWindow.ShowPackageImporterWindow();
if (!ExistAssetFile())
XCResourceImporterWindow.ShowPackageImporterWindow();
}
else
{
@@ -152,6 +151,11 @@ namespace XCharts.Runtime
}
}
public static bool ExistAssetFile()
{
return System.IO.File.Exists("Assets/XCharts/Resources/XCSettings.asset");
}
public static bool AddCustomTheme(Theme theme)
{
if (theme == null) return false;

View File

@@ -86,33 +86,6 @@ namespace XCharts.Runtime
return chartList.Contains(chart);
}
public static bool IsRepeatChartName(BaseChart chart, string chartName = null)
{
if (chartName == null)
chartName = chart.chartName;
if (string.IsNullOrEmpty(chartName))
return false;
foreach (var temp in chartList)
{
if (temp != chart && chartName.Equals(temp.chartName))
return true;
}
return false;
}
public static string GetRepeatChartNameInfo(BaseChart chart, string chartName)
{
if (string.IsNullOrEmpty(chartName))
return string.Empty;
string result = "";
foreach (var temp in chartList)
{
if (temp != chart && chartName.Equals(temp.chartName))
result += ChartHelper.GetFullName(temp.transform) + "\n";
}
return result;
}
public static void RemoveAllChartObject()
{
if (chartList.Count == 0)

View File

@@ -9,12 +9,11 @@ using TMPro;
namespace XCharts.Runtime
{
[Serializable]
/// <summary>
/// Theme.
/// |主题相关配置。
/// </summary>
[Serializable]
public class Theme : ScriptableObject
{
[SerializeField] private ThemeType m_ThemeType = ThemeType.Default;