Exemplo n.º 1
0
        private MathUtility.RegrStats CalcRegressionStats(int Indx)
        {
            List <double> X = new List <double>();
            List <double> Y = new List <double>();

            foreach (Series S in Chart.Series)
            {
                if (S.Active && !S.Title.ToLower().Contains("regression line") && !S.Title.Contains("1:1 line"))
                {
                    if ((!S.Title.Contains("{Checkpoint} ") && Indx == 0) ||
                        S.Title.Contains("{Checkpoint} ") && Indx == 1)
                    {
                        // Add regression stats to chart in footer
                        for (int i = 0; i != S.XValues.Count; i++)
                        {
                            X.Add(S.XValues[i]);
                            Y.Add(S.YValues[i]);
                        }
                    }
                }
            }
            if (X.Count > 0)
            {
                return(MathUtility.CalcRegressionStats(X, Y));
            }
            else
            {
                return(null);
            }
        }