using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
namespace TChart.ImageChart
{
    /// <summary>
    /// 走势图的X轴数据
    /// </summary>
    /// <remarks>
    /// 作者: Kingthy 
    /// 日期: 2007-09-11
    /// MSN:  Kingthy@gmail.com
    /// 转载请注明原作者,当你有更新修改时如果方便的希望能发一份给我.谢谢
    /// </remarks>
    public class XAxisItem
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="title"></param>
        public XAxisItem(string title)
        {
            this.Title = title;
            this.Value = 0;
            this.TitleColor = Color.Black;
            this.TitleFont = new Font(new FontFamily("Arial"), 9, FontStyle.Regular); 
            this.DrawColor = Color.Red;
            this.ValueColor = Color.Black;
            this.ValueFont = new Font(new FontFamily("Arial"), 9, FontStyle.Regular);
            this.ValueVisible = true;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="title"></param>
        /// <param name="value"></param>
        public XAxisItem(string title, decimal value)
        {
            this.Title = title;
            this.Value = value;
            this.TitleColor = Color.Black;
            this.TitleFont = new Font(new FontFamily("Arial"), 9, FontStyle.Regular);
            this.DrawColor = Color.Red;
            this.ValueColor = Color.Black;
            this.ValueFont = new Font(new FontFamily("Arial"), 9, FontStyle.Regular);
            this.ValueVisible = true;
        }

        private string m_Title;
        /// <summary>
        /// 标题
        /// </summary>
        public string Title
        {
            get
            {
                return m_Title;
            }
            set
            {
                m_Title = value;
            }
        }

        private decimal m_Value;
        /// <summary>
        /// 值
        /// </summary>
        public decimal Value
        {
            get
            {
                return m_Value;
            }
            set
            {
                m_Value = value;
            }
        }

        private Color m_TitleColor;
        /// <summary>
        /// 标题的颜色
        /// </summary>
        public Color TitleColor
        {
            get
            {
                return m_TitleColor;
            }
            set
            {
                m_TitleColor = value;
            }
        }

        private Font m_TitleFont;
        /// <summary>
        /// 标题的字体
        /// </summary>
        public Font TitleFont
        {
            get
            {
                return m_TitleFont;
            }
            set
            {
                m_TitleFont = value;
            }
        }

        private Color m_ValueColor;
        /// <summary>
        /// 值的颜色
        /// </summary>
        public Color ValueColor
        {
            get
            {
                return m_ValueColor;
            }
            set
            {
                m_ValueColor = value;
            }
        }

        private Font m_ValueFont;
        /// <summary>
        /// 值的字体
        /// </summary>
        public Font ValueFont
        {
            get
            {
                return m_ValueFont;
            }
            set
            {
                m_ValueFont = value;
            }
        }

        private Color m_DrawColor;
        /// <summary>
        /// 绘制颜色
        /// </summary>
        public Color DrawColor
        {
            get
            {
                return m_DrawColor;
            }
            set
            {
                m_DrawColor = value;
            }
        }

        private bool m_ValueVisible;
        /// <summary>
        /// 值是否可见
        /// </summary>
        public bool ValueVisible
        {
            get
            {
                return m_ValueVisible;
            }
            set
            {
                m_ValueVisible = value;
            }
        }

        /// <summary>
        /// 克隆自身
        /// </summary>
        /// <returns></returns>
        public XAxisItem Clone()
        {
            XAxisItem item = new XAxisItem(this.Title, this.Value)
            {
                TitleColor = this.TitleColor,
                TitleFont = new Font(new FontFamily(this.TitleFont.Name), this.TitleFont.Size, this.TitleFont.Style),

                ValueColor = this.ValueColor,
                ValueVisible = this.ValueVisible,
                ValueFont = new Font(new FontFamily(this.ValueFont.Name), this.ValueFont.Size, this.ValueFont.Style),

                DrawColor = this.DrawColor
            };
            return item;
        }
    }
}
