This commit is contained in:
monitor1394
2022-03-24 08:37:06 +08:00
parent 6cb3709655
commit f597a3f116
78 changed files with 791 additions and 741 deletions

View File

@@ -8,13 +8,13 @@ namespace XCharts.Runtime
{
/// <summary>
/// The base class of all charts.
/// 所有Chart的基类。
/// |所有Chart的基类。
/// </summary>
public partial class BaseChart
{
/// <summary>
/// The name of chart.
/// </summary>
/// |</summary>
public string chartName
{
get { return m_ChartName; }
@@ -32,31 +32,31 @@ namespace XCharts.Runtime
}
/// <summary>
/// The theme.
/// </summary>
/// |</summary>
public ThemeStyle theme { get { return m_Theme; } set { m_Theme = value; } }
/// <summary>
/// Global parameter setting component.
/// 全局设置组件。
/// |全局设置组件。
/// </summary>
public Settings settings { get { return m_Settings; } }
/// <summary>
/// The x of chart.
/// 图表的X
/// The x of chart.
/// |图表的X
/// </summary>
public float chartX { get { return m_ChartX; } }
/// <summary>
/// The y of chart.
/// 图表的Y
/// The y of chart.
/// |图表的Y
/// </summary>
public float chartY { get { return m_ChartY; } }
/// <summary>
/// The width of chart.
/// 图表的宽
/// The width of chart.
/// |图表的宽
/// </summary>
public float chartWidth { get { return m_ChartWidth; } }
/// <summary>
/// The height of chart.
/// 图表的高
/// The height of chart.
/// |图表的高
/// </summary>
public float chartHeight { get { return m_ChartHeight; } }
public Vector2 chartMinAnchor { get { return m_ChartMinAnchor; } }
@@ -65,7 +65,7 @@ namespace XCharts.Runtime
public Vector2 chartSizeDelta { get { return m_ChartSizeDelta; } }
/// <summary>
/// The position of chart.
/// 图表的左下角起始坐标。
/// |图表的左下角起始坐标。
/// </summary>
public Vector3 chartPosition { get { return m_ChartPosition; } }
public Rect chartRect { get { return m_ChartRect; } }
@@ -93,12 +93,12 @@ namespace XCharts.Runtime
public CustomDrawGaugePointerFunction customDrawGaugePointerFunction { set { m_CustomDrawGaugePointerFunction = value; } get { return m_CustomDrawGaugePointerFunction; } }
/// <summary>
/// the callback function of click pie area.
/// 点击饼图区域回调。参数PointerEventDataSerieIndexSerieDataIndex
/// |点击饼图区域回调。参数PointerEventDataSerieIndexSerieDataIndex
/// </summary>
public Action<PointerEventData, int, int> onPointerClickPie { set { m_OnPointerClickPie = value; m_ForceOpenRaycastTarget = true; } get { return m_OnPointerClickPie; } }
/// <summary>
/// the callback function of click bar.
/// 点击柱形图柱条回调。参数eventData, dataIndex
/// the callback function of click bar.
/// |点击柱形图柱条回调。参数eventData, dataIndex
/// </summary>
public Action<PointerEventData, int> onPointerClickBar { set { m_OnPointerClickBar = value; m_ForceOpenRaycastTarget = true; } }
/// <summary>
@@ -120,7 +120,7 @@ namespace XCharts.Runtime
}
/// <summary>
/// Redraw chart in next frame.
/// 在下一帧刷新图表。
/// |在下一帧刷新图表。
/// </summary>
public void RefreshChart()
{
@@ -130,8 +130,8 @@ namespace XCharts.Runtime
/// <summary>
/// Remove all series and legend data.
/// It just emptying all of serie's data without emptying the list of series.
/// 清除所有数据,系列中只是移除数据,列表会保留。
/// |It just emptying all of serie's data without emptying the list of series.
/// |清除所有数据,系列中只是移除数据,列表会保留。
/// </summary>
public virtual void ClearData()
{
@@ -145,8 +145,8 @@ namespace XCharts.Runtime
/// <summary>
/// Remove all data from series and legend.
/// The series list is also cleared.
/// 清除所有系列和图例数据,系列的列表也会被清除。
/// |The series list is also cleared.
/// |清除所有系列和图例数据,系列的列表也会被清除。
/// </summary>
public virtual void RemoveData()
{
@@ -160,7 +160,7 @@ namespace XCharts.Runtime
/// <summary>
/// Remove legend and serie by name.
/// 清除指定系列名称的数据。
/// |清除指定系列名称的数据。
/// </summary>
/// <param name="serieName">the name of serie</param>
public virtual void RemoveData(string serieName)
@@ -198,7 +198,7 @@ namespace XCharts.Runtime
/// <summary>
/// Whether serie is activated.
/// 获得指定图例名字的系列是否显示。
/// |获得指定图例名字的系列是否显示。
/// </summary>
/// <param name="legendName"></param>
/// <returns></returns>
@@ -227,7 +227,7 @@ namespace XCharts.Runtime
/// <summary>
/// Update chart theme.
/// 切换内置主题。
/// |切换内置主题。
/// </summary>
/// <param name="theme">theme</param>
public bool UpdateTheme(ThemeType theme)
@@ -245,7 +245,7 @@ namespace XCharts.Runtime
/// <summary>
/// Update chart theme info.
/// 切换图表主题。
/// |切换图表主题。
/// </summary>
/// <param name="theme">theme</param>
public void UpdateTheme(Theme theme)
@@ -259,7 +259,7 @@ namespace XCharts.Runtime
/// <summary>
/// Whether series animation enabel.
/// 启用或关闭起始动画。
/// |启用或关闭起始动画。
/// </summary>
/// <param name="flag"></param>
public void AnimationEnable(bool flag)
@@ -269,7 +269,7 @@ namespace XCharts.Runtime
/// <summary>
/// fadeIn animation.
/// 开始渐入动画。
/// |开始渐入动画。
/// </summary>
public void AnimationFadeIn()
{
@@ -278,7 +278,7 @@ namespace XCharts.Runtime
/// <summary>
/// fadeIn animation.
/// 开始渐出动画。
/// |开始渐出动画。
/// </summary>
public void AnimationFadeOut()
{
@@ -287,7 +287,7 @@ namespace XCharts.Runtime
/// <summary>
/// Pause animation.
/// 暂停动画。
/// |暂停动画。
/// </summary>
public void AnimationPause()
{
@@ -296,7 +296,7 @@ namespace XCharts.Runtime
/// <summary>
/// Stop play animation.
/// 继续动画。
/// |继续动画。
/// </summary>
public void AnimationResume()
{
@@ -305,7 +305,7 @@ namespace XCharts.Runtime
/// <summary>
/// Reset animation.
/// 重置动画。
/// |重置动画。
/// </summary>
public void AnimationReset()
{

View File

@@ -349,7 +349,7 @@ namespace XCharts.Runtime
/// <summary>
/// reutrn true when all the show axis is `Value` type.
/// 纯数值坐标轴(数值轴或对数轴)。
/// |纯数值坐标轴(数值轴或对数轴)。
/// </summary>
public bool IsAllAxisValue()
{

View File

@@ -194,8 +194,8 @@ namespace XCharts.Runtime
/// <summary>
/// Add a data to serie.
/// If serieName doesn't exist in legend,will be add to legend.
/// 添加一个数据到指定的系列中。
/// |If serieName doesn't exist in legend,will be add to legend.
/// |添加一个数据到指定的系列中。
/// </summary>
/// <param name="serieName">the name of serie</param>
/// <param name="data">the data to add</param>
@@ -216,7 +216,7 @@ namespace XCharts.Runtime
/// <summary>
/// Add a data to serie.
/// 添加一个数据到指定的系列中。
/// |添加一个数据到指定的系列中。
/// </summary>
/// <param name="serieIndex">the index of serie</param>
/// <param name="data">the data to add</param>
@@ -237,7 +237,7 @@ namespace XCharts.Runtime
/// <summary>
/// Add an arbitray dimension data to serie,such as (x,y,z,...).
/// 添加多维数据x,y,z...)到指定的系列中。
/// |添加多维数据x,y,z...)到指定的系列中。
/// </summary>
/// <param name="serieName">the name of serie</param>
/// <param name="multidimensionalData">the (x,y,z,...) data</param>
@@ -258,7 +258,7 @@ namespace XCharts.Runtime
/// <summary>
/// Add an arbitray dimension data to serie,such as (x,y,z,...).
/// 添加多维数据x,y,z...)到指定的系列中。
/// |添加多维数据x,y,z...)到指定的系列中。
/// </summary>
/// <param name="serieIndex">the index of serie,index starts at 0</param>
/// <param name="multidimensionalData">the (x,y,z,...) data</param>
@@ -279,7 +279,7 @@ namespace XCharts.Runtime
/// <summary>
/// Add a (x,y) data to serie.
/// 添加x,y数据到指定系列中。
/// |添加x,y数据到指定系列中。
/// </summary>
/// <param name="serieName">the name of serie</param>
/// <param name="xValue">x data</param>
@@ -301,7 +301,7 @@ namespace XCharts.Runtime
/// <summary>
/// Add a (x,y) data to serie.
/// 添加x,y数据到指定系列中。
/// |添加x,y数据到指定系列中。
/// </summary>
/// <param name="serieIndex">the index of serie</param>
/// <param name="xValue">x data</param>
@@ -345,7 +345,7 @@ namespace XCharts.Runtime
/// <summary>
/// Update serie data by serie name.
/// 更新指定系列中的指定索引数据。
/// |更新指定系列中的指定索引数据。
/// </summary>
/// <param name="serieName">the name of serie</param>
/// <param name="dataIndex">the index of data</param>
@@ -364,7 +364,7 @@ namespace XCharts.Runtime
/// <summary>
/// Update serie data by serie index.
/// 更新指定系列中的指定索引数据。
/// |更新指定系列中的指定索引数据。
/// </summary>
/// <param name="serieIndex">the index of serie</param>
/// <param name="dataIndex">the index of data</param>
@@ -457,7 +457,7 @@ namespace XCharts.Runtime
/// <summary>
/// Update serie data name.
/// 更新指定系列中的指定索引数据名称。
/// |更新指定系列中的指定索引数据名称。
/// </summary>
/// <param name="serieName"></param>
/// <param name="dataIndex"></param>
@@ -475,7 +475,7 @@ namespace XCharts.Runtime
/// <summary>
/// Update serie data name.
/// 更新指定系列中的指定索引数据名称。
/// |更新指定系列中的指定索引数据名称。
/// </summary>
/// <param name="serieIndex"></param>
/// <param name="dataName"></param>
@@ -521,7 +521,7 @@ namespace XCharts.Runtime
/// <summary>
/// Whether to show serie.
/// 设置指定系列是否显示。
/// |设置指定系列是否显示。
/// </summary>
/// <param name="serieName">the name of serie</param>
/// <param name="active">Active or not</param>
@@ -534,7 +534,7 @@ namespace XCharts.Runtime
/// <summary>
/// Whether to show serie.
/// 设置指定系列是否显示。
/// |设置指定系列是否显示。
/// </summary>
/// <param name="serieIndex">the index of serie</param>
/// <param name="active">Active or not</param>
@@ -555,7 +555,7 @@ namespace XCharts.Runtime
/// <summary>
/// Add a category data to xAxis.
/// 添加一个类目数据到指定的x轴。
/// |添加一个类目数据到指定的x轴。
/// </summary>
/// <param name="category">the category data</param>
/// <param name="xAxisIndex">which xAxis should category add to</param>
@@ -570,7 +570,7 @@ namespace XCharts.Runtime
/// <summary>
/// Update category data.
/// 更新X轴类目数据。
/// |更新X轴类目数据。
/// </summary>
/// <param name="index">the index of category data</param>
/// <param name="category"></param>
@@ -586,7 +586,7 @@ namespace XCharts.Runtime
/// <summary>
/// Add an icon to xAxis.
/// 添加一个图标到指定的x轴。
/// |添加一个图标到指定的x轴。
/// </summary>
/// <param name="icon"></param>
/// <param name="xAxisIndex"></param>
@@ -601,7 +601,7 @@ namespace XCharts.Runtime
/// <summary>
/// Update xAxis icon.
/// 更新X轴图标。
/// |更新X轴图标。
/// </summary>
/// <param name="index"></param>
/// <param name="icon"></param>
@@ -617,7 +617,7 @@ namespace XCharts.Runtime
/// <summary>
/// Add a category data to yAxis.
/// 添加一个类目数据到指定的y轴。
/// |添加一个类目数据到指定的y轴。
/// </summary>
/// <param name="category">the category data</param>
/// <param name="yAxisIndex">which yAxis should category add to</param>
@@ -632,7 +632,7 @@ namespace XCharts.Runtime
/// <summary>
/// Update category data.
/// 更新Y轴类目数据。
/// |更新Y轴类目数据。
/// </summary>
/// <param name="index">the index of category data</param>
/// <param name="category"></param>
@@ -648,7 +648,7 @@ namespace XCharts.Runtime
/// <summary>
/// Add an icon to yAxis.
/// 添加一个图标到指定的y轴。
/// |添加一个图标到指定的y轴。
/// </summary>
/// <param name="icon"></param>
/// <param name="yAxisIndex"></param>

View File

@@ -7,44 +7,44 @@ namespace XCharts.Runtime
{
/// <summary>
/// The base class of all graphs or components.
/// 所有图形的基类。
/// |所有图形的基类。
/// </summary>
public partial class BaseGraph
{
/// <summary>
/// The x of graph.
/// 图形的X
/// The x of graph.
/// |图形的X
/// </summary>
public float graphX { get { return m_GraphX; } }
/// <summary>
/// The y of graph.
/// 图形的Y
/// The y of graph.
/// |图形的Y
/// </summary>
public float graphY { get { return m_GraphY; } }
/// <summary>
/// The width of graph.
/// 图形的宽
/// The width of graph.
/// |图形的宽
/// </summary>
public float graphWidth { get { return m_GraphWidth; } }
/// <summary>
/// The height of graph.
/// 图形的高
/// The height of graph.
/// |图形的高
/// </summary>
public float graphHeight { get { return m_GraphHeight; } }
/// <summary>
/// The position of graph.
/// 图形的左下角起始坐标。
/// |图形的左下角起始坐标。
/// </summary>
public Vector3 graphPosition { get { return m_GraphPosition; } }
public Rect graphRect { get { return m_GraphRect; } }
/// <summary>
/// The postion of pointer.
/// 鼠标位置。
/// |鼠标位置。
/// </summary>
public Vector2 pointerPos { get; protected set; }
/// <summary>
/// Whether the mouse pointer is in the chart.
/// 鼠标是否在图表内。
/// |鼠标是否在图表内。
/// </summary>
public bool isPointerInChart { get; protected set; }
/// <summary>
@@ -119,7 +119,7 @@ namespace XCharts.Runtime
/// <summary>
/// Redraw graph in next frame.
/// 在下一帧刷新图形。
/// |在下一帧刷新图形。
/// </summary>
public void RefreshGraph()
{

View File

@@ -6,7 +6,7 @@ namespace XCharts.Runtime
{
/// <summary>
/// Coordinate system component.
///
/// |
/// 坐标系系统。
/// </summary>
[Serializable]

View File

@@ -7,7 +7,7 @@ namespace XCharts.Runtime
{
/// <summary>
/// The delegate function for AxisLabel's formatter.
/// AxisLabel的formatter自定义委托。
/// |AxisLabel的formatter自定义委托。
/// </summary>
/// <param name="labelIndex">label索引</param>
/// <param name="value">当前label对应的数值数据Value轴或Time轴有效</param>
@@ -16,7 +16,7 @@ namespace XCharts.Runtime
public delegate string AxisLabelFormatterFunction(int labelIndex, double value, string category);
/// <summary>
/// The delegate function for SerieLabels formatter.
/// SerieLabel的formatter自定义委托。
/// |SerieLabel的formatter自定义委托。
/// </summary>
/// <param name="dataIndex">数据索引</param>
/// <param name="value">数值</param>

View File

@@ -4,7 +4,7 @@ namespace XCharts.Runtime
{
/// <summary>
/// the layout is horizontal or vertical.
/// 垂直还是水平布局方式。
/// |垂直还是水平布局方式。
/// </summary>
public enum Orient
{

View File

@@ -127,8 +127,7 @@ namespace XCharts.Runtime
public class XChartsPackageResourceImporterWindow : UnityEditor.EditorWindow
{
[SerializeField]
XCResourcesImporter m_ResourceImporter;
[SerializeField] XCResourcesImporter m_ResourceImporter;
static XChartsPackageResourceImporterWindow m_ImporterWindow;
@@ -168,7 +167,7 @@ namespace XCharts.Runtime
/// <summary>
/// Limits the minimum size of the editor window.
/// </summary>
/// |</summary>
void SetEditorWindowSize()
{
EditorWindow editorWindow = this;

View File

@@ -29,6 +29,12 @@ namespace XCharts.Runtime
}
}
public static void CheckReloadTheme()
{
if (XChartsMgr.themeNames.Count < 0)
ReloadThemeList();
}
public static void AddTheme(Theme theme)
{
if (theme == null) return;