示例#1
0
        public void MyAction()
        {
            try
            {
                #region Update TxtOutput
                string txtSalida  = string.Empty;
                string txtEntrada = String.Copy(TxtInput);
                string salto      = "\n";
                txtEntrada.Replace(salto, "");
                double[] data = TxtInput.Split(';').Select(n => Convert.ToDouble(n)).ToArray();
                txtSalida += "Minimum: " + data.Minimum();
                txtSalida += salto + "Maximum: " + data.Maximum();
                txtSalida += salto + "Count: " + data.Count();
                txtSalida += salto + "Mean: " + data.Mean();
                txtSalida += salto + "Median: " + data.Median();
                txtSalida += salto + "Variance: " + data.Variance();
                txtSalida += salto + "StandardDeviation: " + data.StandardDeviation();
                txtSalida += salto + "MaximumAbsolute: " + data.MaximumAbsolute();
                txtSalida += salto + "MinimumAbsolute: " + data.MinimumAbsolute();
                TxtOutput  = txtSalida;
                #endregion

                #region Update Chart Line
                ChartValues <double> cv = new ChartValues <double>();
                cv.AddRange(data);

                var lineSerie = new LineSeries
                {
                    Title  = "Values",
                    Values = cv,
                };

                //Bug Series.clear()
                while (series.Count > 0)
                {
                    series.RemoveAt(series.Count - 1);
                }

                series.Add(lineSerie);
                #endregion
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message);
            }
        }