private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (typePrediction.Text == "Полигармонический")
     {
         if (from.Text != "" && to.Text != "" || from.Text == "0" && to.Text == "0")
         {
             PredictionVM.GetAnaliticsPoly(predictionChart, outDG, MainDataVM.arr_data, Convert.ToInt32(from.Text), Convert.ToInt32(to.Text));
         }
         else
         {
             PredictionVM.GetAnaliticsPoly(predictionChart, outDG, MainDataVM.arr_data, 0, MainDataVM.arr_data.Length - 1);
         }
     }
     else if (typePrediction.Text == "Экспоненциальный")
     {
         if (from.Text != "" && to.Text != "")
         {
             PredictionVM.GetAnaliticsExp(predictionChart, outDG, MainDataVM.arr_data, Convert.ToInt32(from.Text), Convert.ToInt32(to.Text), Convert.ToDouble(need_error.Text));
         }
         else
         {
             PredictionVM.GetAnaliticsExp(predictionChart, outDG, MainDataVM.arr_data, 0, MainDataVM.arr_data.Length - 1, Convert.ToDouble(need_error.Text));
         }
     }
     else if (typePrediction.Text == "Скользящее среднее")
     {
         if (from.Text != "" && to.Text != "")
         {
             PredictionVM.GetAnaliticsMidle(predictionChart, outDG, MainDataVM.arr_data, Convert.ToInt32(from.Text), Convert.ToInt32(to.Text), 0);
         }
         else
         {
             PredictionVM.GetAnaliticsMidle(predictionChart, outDG, MainDataVM.arr_data, 0, MainDataVM.arr_data.Length - 1, 0);
         }
     }
 }