using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace XCharts.Runtime
{
    /// 
    /// The base class of all charts.
    /// ||所有Chart的基类。
    /// 
    public partial class BaseChart
    {
        /// 
        /// The name of chart.
        /// ||
        public string chartName
        {
            get { return m_ChartName; }
            set
            {
                if (!string.IsNullOrEmpty(value) && XChartsMgr.ContainsChart(value))
                {
                    Debug.LogError("chartName repeated:" + value);
                }
                else
                {
                    m_ChartName = value;
                }
            }
        }
        /// 
        /// The theme.
        /// ||
        public ThemeStyle theme { get { return m_Theme; } set { m_Theme = value; } }
        /// 
        /// Global parameter setting component.
        /// ||全局设置组件。
        /// 
        public Settings settings { get { return m_Settings; } }
        /// 
        /// The x of chart.
        /// ||图表的X
        /// 
        public float chartX { get { return m_ChartX; } }
        /// 
        /// The y of chart.
        /// ||图表的Y
        /// 
        public float chartY { get { return m_ChartY; } }
        /// 
        /// The width of chart.
        /// ||图表的宽
        /// 
        public float chartWidth { get { return m_ChartWidth; } }
        /// 
        /// The height of chart.
        /// ||图表的高
        /// 
        public float chartHeight { get { return m_ChartHeight; } }
        public Vector2 chartMinAnchor { get { return m_ChartMinAnchor; } }
        public Vector2 chartMaxAnchor { get { return m_ChartMaxAnchor; } }
        public Vector2 chartPivot { get { return m_ChartPivot; } }
        public Vector2 chartSizeDelta { get { return m_ChartSizeDelta; } }
        /// 
        /// The position of chart.
        /// ||图表的左下角起始坐标。
        /// 
        public Vector3 chartPosition { get { return m_ChartPosition; } }
        public Rect chartRect { get { return m_ChartRect; } }
        /// 
        /// The callback function of chart init.
        /// ||图表的初始化完成回调。
        /// 
        public Action onInit { set { m_OnInit = value; } }
        /// 
        /// The callback function of chart update.
        /// ||图表的Update回调。
        /// 
        public Action onUpdate { set { m_OnUpdate = value; } }
        /// 
        /// 自定义绘制回调。在绘制Serie前调用。
        /// 
        public Action onDraw { set { m_OnDrawBase = value; } }
        /// 
        /// 自定义Serie绘制回调。在每个Serie绘制完前调用。
        /// 
        public Action onDrawBeforeSerie { set { m_OnDrawSerieBefore = value; } }
        /// 
        /// 自定义Serie绘制回调。在每个Serie绘制完后调用。
        /// 
        public Action onDrawAfterSerie { set { m_OnDrawSerieAfter = value; } }
        /// 
        /// 自定义Upper层绘制回调。在绘制Tooltip前调用。
        /// 
        public Action onDrawUpper { set { m_OnDrawUpper = value; } }
        /// 
        /// 自定义Top层绘制回调。在绘制Tooltip前调用。
        /// 
        public Action onDrawTop { set { m_OnDrawTop = value; } }
        /// 
        /// 自定义仪表盘指针绘制委托。
        /// 
        public CustomDrawGaugePointerFunction customDrawGaugePointerFunction { set { m_CustomDrawGaugePointerFunction = value; } get { return m_CustomDrawGaugePointerFunction; } }
        /// 
        /// the callback function of pointer click serie.
        /// ||鼠标点击Serie回调。
        /// 
        [Since("v3.6.0")]
        public Action onSerieClick { set { m_OnSerieClick = value; m_ForceOpenRaycastTarget = true; } get { return m_OnSerieClick; } }
        /// 
        /// the callback function of pointer down serie.
        /// ||鼠标按下Serie回调。
        /// 
        [Since("v3.6.0")]
        public Action onSerieDown { set { m_OnSerieDown = value; m_ForceOpenRaycastTarget = true; } get { return m_OnSerieDown; } }
        /// 
        /// the callback function of pointer enter serie.
        /// ||鼠标进入Serie回调。
        /// 
        [Since("v3.6.0")]
        public Action onSerieEnter { set { m_OnSerieEnter = value; m_ForceOpenRaycastTarget = true; } get { return m_OnSerieEnter; } }
        /// 
        /// the callback function of pointer exit serie.
        /// ||鼠标离开Serie回调。
        /// 
        [Since("v3.6.0")]
        public Action onSerieExit { set { m_OnSerieExit = value; m_ForceOpenRaycastTarget = true; } get { return m_OnSerieExit; } }
        /// 
        /// the callback function of pointer click pie area.
        /// ||点击饼图区域回调。参数:PointerEventData,SerieIndex,SerieDataIndex
        /// 
        [Obsolete("Use \"onSerieClick\" instead", true)]
        public Action onPointerClickPie { get; set; }
        /// 
        /// the callback function of pointer enter pie area.
        /// ||鼠标进入和离开饼图区域回调,SerieDataIndex为-1时表示离开。参数:PointerEventData,SerieIndex,SerieDataIndex
        /// 
        [Since("v3.3.0")]
        [Obsolete("Use \"onSerieEnter\" instead", true)]
        public Action onPointerEnterPie { set { m_OnPointerEnterPie = value; m_ForceOpenRaycastTarget = true; } get { return m_OnPointerEnterPie; } }
        /// 
        /// the callback function of click bar.
        /// ||点击柱形图柱条回调。参数:eventData, dataIndex
        /// 
        [Obsolete("Use \"onSerieClick\" instead", true)]
        public Action onPointerClickBar { get; set; }
        /// 
        /// 坐标轴变更数据索引时回调。参数:axis, dataIndex/dataValue
        /// 
        public Action onAxisPointerValueChanged { set { m_OnAxisPointerValueChanged = value; } get { return m_OnAxisPointerValueChanged; } }
        /// 
        /// the callback function of click legend.
        /// ||点击图例按钮回调。参数:legendIndex, legendName, show
        /// 
        public Action