Devexpress Chart series 点击时获取SeriesPoint的值

Devexpress Chart series 点击时获取SeriesPoint的值

在这里做个备注:

复制代码

  public partial class XtraForm2 : DevExpress.XtraEditors.XtraForm
    {
        private LabelControl _labelControl;
        private int xpoint;
        private int yponit;
        public XtraForm2()
        {
            InitializeComponent();
            _labelControl = new LabelControl();
            chartControl1.Controls.Add(_labelControl);
            chartControl1.MouseClick += new MouseEventHandler(ChartControl1MouseClick);
        }

        void ChartControl1MouseClick(object sender, MouseEventArgs e)
        {
            xpoint = e.X;
            yponit = e.Y;
        }
        private void ChartControl1ObjectSelected(object sender, DevExpress.XtraCharts.HotTrackEventArgs e)
        {
            
            if (e.AdditionalObject == null) return;
            SeriesPoint point = (SeriesPoint)e.AdditionalObject;
            string ms = string.Format("Value{0},argument:{1}", point.ValuesSerializable, point.Argument);         
            _labelControl.Text = string.Empty;
            _labelControl.Location = new Point(xpoint, yponit);
            _labelControl.Text = "值:" + point.ValuesSerializable;
           

        }


    }

复制代码

 

posted @ 2019-06-05 18:08  grj001  阅读(140)  评论(0编辑  收藏  举报