Exemple #1
0
 private void button4_Click(object sender, EventArgs e)
 {
     int period;
     if (!int.TryParse(textBox1.Text, out period))
         MessageBox.Show("Число років прогнозування має бути цілим");
     IForecast lineFc = new ParabolForecast();
     double[] _years;
     double[] _counts;
     lineFc.MakeForecast(years, count, out _years, out _counts, period);
     string[] lables = new string[_years.Length];
     for (int i = 0; i < _years.Length; i++)
     {
         lables[i] = string.Format("{0}", _years[i]);
     }
     double[] bars = new double[_counts.Length];
     double[] forecastyears = new double[_counts.Length];
     for(int i = _counts.Length-period;i<_counts.Length;i++)
     {
         forecastyears[i] = _years[i];
         bars[i] = _counts[i];
     }
     zedGraphControl1.GraphPane.XAxis.Scale.TextLabels = lables;
     zedGraphControl1.GraphPane.AddCurve("Параболічний прогноз", _years, _counts, Color.Green);
     zedGraphControl1.GraphPane.AddBar("Параболічний прогноз", forecastyears, bars, Color.FromArgb(100, 12,230,13));
     zedGraphControl1.AxisChange();
     zedGraphControl1.Refresh();
 }
Exemple #2
0
 private void button4_Click(object sender, EventArgs e)
 {
     int period;
     if (!int.TryParse(textBox1.Text, out period))
         MessageBox.Show("Число років прогнозування має бути цілим");
     IForecast lineFc = new ParabolForecast();
     double[] _years;
     double[] _counts;
     lineFc.MakeForecast(years, count, out _years, out _counts, period);
     string[] lables = new string[_years.Length];
     for (int i = 0; i < _years.Length; i++)
     {
         lables[i] = string.Format("{0}", _years[i]);
     }
     double[] bars = new double[_counts.Length];
     double[] forecastyears = new double[_counts.Length];
     for(int i = _counts.Length-period;i<_counts.Length;i++)
     {
         forecastyears[i] = _years[i];
         bars[i] = _counts[i];
     }
     zedGraphControl1.GraphPane.XAxis.Scale.TextLabels = lables;
     zedGraphControl1.GraphPane.AddCurve("Параболічний прогноз", _years, _counts, Color.Green);
     zedGraphControl1.GraphPane.AddBar("Параболічний прогноз", forecastyears, bars, Color.FromArgb(100, 12,230,13));
     zedGraphControl1.AxisChange();
     zedGraphControl1.Refresh();
 }