Esempio n. 1
0
 private void button3_Click(object sender, EventArgs e)
 {
     int period;
     if (!int.TryParse(textBox1.Text, out period))
         MessageBox.Show("Число років прогнозування має бути цілим");
     IForecast lineFc = new ExpForecast();
     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.AddBar("Експоненційний прогноз", forecastyears, bars, Color.FromArgb(100, 210, 2, 10));
     zedGraphControl1.GraphPane.AddCurve("Експоненційний прогноз", _years, _counts, Color.Red);
     zedGraphControl1.AxisChange();
     zedGraphControl1.Refresh();
 }
Esempio n. 2
0
 private void button3_Click(object sender, EventArgs e)
 {
     int period;
     if (!int.TryParse(textBox1.Text, out period))
         MessageBox.Show("Число років прогнозування має бути цілим");
     IForecast lineFc = new ExpForecast();
     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.AddBar("Експоненційний прогноз", forecastyears, bars, Color.FromArgb(100, 210, 2, 10));
     zedGraphControl1.GraphPane.AddCurve("Експоненційний прогноз", _years, _counts, Color.Red);
     zedGraphControl1.AxisChange();
     zedGraphControl1.Refresh();
 }