Пример #1
0
        public void ParametrsOnGraph_Values(int secforaver, DateTime pstart, DateTime pend)
        {
            ObservableCollection <Line_for_Table> Rezult = new ObservableCollection <Line_for_Table>();
            Line_for_Table line = new Line_for_Table();

            foreach (var item in chart_ref.Series)
            {
                try
                {
                    line.KKS             = item.Name;
                    line.Value           = FindPoint(item.Points, DateTime.FromOADate(chart_ref.ChartAreas[item.ChartArea].CursorX.Position)).YValues[0];
                    line.PointTime       = DateTime.FromOADate(chart_ref.ChartAreas[item.ChartArea].CursorX.Position);
                    line.AverageValue    = FindAverage(item.Points, DateTime.FromOADate(chart_ref.ChartAreas[item.ChartArea].CursorX.Position), secforaver);
                    line.AverageValueBTW = FindAverage(item.Points, pstart, pend);
                    Rezult.Add(line);
                }
                catch (Exception)
                { }
            }



            TableList = Rezult;
            // return Rezult;
        }
Пример #2
0
        /// <summary>
        /// Список легенд с графика. Значения в месте курсора.
        /// </summary>
        /// <returns></returns>
        public void ParametrsOnGraph_Values(int secforaver)
        {
            ObservableCollection <Line_for_Table> Rezult = new ObservableCollection <Line_for_Table>();
            Line_for_Table line = new Line_for_Table();

            foreach (var item in chart_ref.Series)
            {
                try
                {
                    line.KKS          = item.Name;
                    line.Value        = FindPoint(item.Points, DateTime.FromOADate(chart_ref.ChartAreas[item.ChartArea].CursorX.Position)).YValues[0];
                    line.PointTime    = DateTime.FromOADate(chart_ref.ChartAreas[item.ChartArea].CursorX.Position);
                    line.AverageValue = FindAverage(item.Points, DateTime.FromOADate(chart_ref.ChartAreas[item.ChartArea].CursorX.Position), secforaver);
                    Rezult.Add(line);
                }
                catch (Exception)
                { MessageBox.Show("Ошибка в поиске в классе culculations"); }
            }



            TableList = Rezult;
            // return Rezult;
        }