Esempio n. 1
0
        public static void DrawSeriesData(List <double> series, int startIndex)
        {
            Plot_Form form = new Plot_Form
            {
                chart1 =
                {
                    ChartAreas               = { [0]      =
                                   {
                                   AxisX = { Interval = Math.Ceiling((double)((1.0 * (series.Count - startIndex)) / 20.0)) },
                                   //Text = "Time series",
                                   //Color = Color.Blue
                                   } },
                    Titles                   = { [0]      =
                               {
                               //AxisX = { Interval = Math.Ceiling((double) ((1.0 * (series.Count - startIndex)) / 20.0)) },
                               Text      = "Time series",
                               //Color = Color.Blue
                               } },
                    Series                   = { [0]      =
                               {
                               //AxisX = { Interval = Math.Ceiling((double) ((1.0 * (series.Count - startIndex)) / 20.0)) },
                               //Text = "Time series",
                               Color     = Color.Blue
                               } }
                }
            };

            for (int i = startIndex; i < series.Count; i++)
            {
                form.chart1.Series["Data"].Points.AddXY((double)(i + 1), series.ElementAt <double>(i));
            }
            form.Show();
        }
Esempio n. 2
0
        public static void DrawForecastSeriesData(List <double> firstSeries, int firstStartIndex, List <double> secondSeries, int secondStartIndex)
        {
            Plot_Form form = new Plot_Form();

            System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
            series1.ChartArea         = "ChartArea1";
            series1.ChartType         = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
            series1.Color             = System.Drawing.Color.Blue;
            series1.IsVisibleInLegend = false;

            System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
            series2.ChartArea         = "ChartArea1";
            series2.ChartType         = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
            series2.Color             = System.Drawing.Color.Red;
            series2.IsVisibleInLegend = false;

            form.chart1.ChartAreas[0].AxisX.Interval = Math.Ceiling(1.0 * (firstSeries.Count - firstStartIndex) / 20);
            form.chart1.Titles["Title1"].Text        = "Time series";
            form.chart1.Series["Data"].Color         = System.Drawing.Color.Blue;
            for (int i = firstStartIndex; i < firstSeries.Count; i++)
            {
                series1.Points.AddXY(i + 1, firstSeries[i]);
            }
            form.chart1.Series.Add(series1);

            series2.Points.AddXY(firstSeries.Count, firstSeries[firstSeries.Count - 1]);
            for (int i = secondStartIndex; i < secondSeries.Count; i++)
            {
                series2.Points.AddXY(i + 1 + firstSeries.Count - secondStartIndex, secondSeries[i]);
            }
            form.chart1.Series.Add(series2);

            form.ShowDialog();
        }
Esempio n. 3
0
        public static void DrawAutocorrelation(List <double> listAutocorrelation, List <double> listConfidenceLimit, bool isPACF = false)
        {
            Plot_Form form = new Plot_Form();

            if (!isPACF)
            {
                form.chart1.Titles["Title1"].Text = "Autocorrelation Function";
                form.chart1.ChartAreas["ChartArea1"].Axes[0].Title = "Lag";
                form.chart1.ChartAreas["ChartArea1"].Axes[1].Title = "ACF";
                form.chart1.Series[0].Name = "ACF";
            }
            else
            {
                form.chart1.Titles["Title1"].Text = "Partial Autocorrelation Function";
                form.chart1.ChartAreas["ChartArea1"].Axes[0].Title = "Lag";
                form.chart1.ChartAreas["ChartArea1"].Axes[1].Title = "PACF";
                form.chart1.Series[0].Name = "PACF";
            }

            int numData = listAutocorrelation.Count;

            form.chart1.ChartAreas[0].AxisX.Interval = Math.Ceiling(1.0 * numData / 20);
            System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
            series1.ChartArea         = "ChartArea1";
            series1.ChartType         = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
            series1.Color             = System.Drawing.Color.Red;
            series1.IsVisibleInLegend = false;

            System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
            series2.ChartArea         = "ChartArea1";
            series2.ChartType         = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
            series2.Color             = System.Drawing.Color.Red;
            series2.IsVisibleInLegend = false;

            int start = 0;

            if (isPACF)
            {
                start = 1;
            }
            for (int i = 0; i < listAutocorrelation.Count; i++)
            {
                System.Windows.Forms.DataVisualization.Charting.Series series = new System.Windows.Forms.DataVisualization.Charting.Series();
                series.ChartArea = "ChartArea1";
                series.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
                series.Color     = System.Drawing.Color.Blue;
                series.Points.AddXY(start + i, 0.0);
                series.Points.AddXY(start + i, listAutocorrelation[i]);
                series.IsVisibleInLegend = false;
                form.chart1.Series.Add(series);

                series1.Points.AddXY(start + i, listConfidenceLimit[i]);
                series2.Points.AddXY(start + i, -listConfidenceLimit[i]);
            }

            form.chart1.Series.Add(series1);
            form.chart1.Series.Add(series2);

            form.ShowDialog();
        }
Esempio n. 4
0
        public static void DrawSeriesData(List <double> series, int startIndex)
        {
            Plot_Form form = new Plot_Form();

            form.chart1.ChartAreas[0].AxisX.Interval = Math.Ceiling(1.0 * (series.Count - startIndex) / 20);
            form.chart1.Titles["Title1"].Text        = "Time series";
            form.chart1.Series["Data"].Color         = System.Drawing.Color.Blue;
            for (int i = startIndex; i < series.Count; i++)
            {
                form.chart1.Series["Data"].Points.AddXY(i + 1, series.ElementAt(i));
            }
            form.ShowDialog();
        }
Esempio n. 5
0
        public static void DrawAutocorrelation(List <double> listAutocorrelation, List <double> listConfidenceLimit, bool isPACF = false)
        {
            Plot_Form form = new Plot_Form();

            if (!isPACF)
            {
                form.chart1.Titles["Title1"].Text = "Autocorrelation Function";
                form.chart1.ChartAreas["ChartArea1"].Axes[0].Title = "Lag";
                form.chart1.ChartAreas["ChartArea1"].Axes[1].Title = "ACF";
                form.chart1.Series[0].Name = "ACF";
            }
            else
            {
                form.chart1.Titles["Title1"].Text = "Partial Autocorrelation Function";
                form.chart1.ChartAreas["ChartArea1"].Axes[0].Title = "Lag";
                form.chart1.ChartAreas["ChartArea1"].Axes[1].Title = "PACF";
                form.chart1.Series[0].Name = "PACF";
            }
            int count = listAutocorrelation.Count;

            form.chart1.ChartAreas[0].AxisX.Interval = Math.Ceiling((double)((1.0 * count) / 20.0));
            Series item = new Series
            {
                ChartArea         = "ChartArea1",
                ChartType         = SeriesChartType.Line,
                Color             = Color.Red,
                IsVisibleInLegend = false
            };
            Series series2 = new Series
            {
                ChartArea         = "ChartArea1",
                ChartType         = SeriesChartType.Line,
                Color             = Color.Red,
                IsVisibleInLegend = false
            };
            Series series3 = new Series
            {
                ChartArea         = "ChartArea1",
                ChartType         = SeriesChartType.Line,
                Color             = Color.Black,
                IsVisibleInLegend = false
            };
            int num2 = 0;

            if (isPACF)
            {
                num2 = 1;
            }
            for (int i = 0; i < listAutocorrelation.Count; i++)
            {
                Series series4 = new Series
                {
                    ChartArea = "ChartArea1",
                    ChartType = SeriesChartType.Line,
                    Color     = Color.Blue
                };
                series4.Points.AddXY((double)(num2 + i), 0.0);
                series4.Points.AddXY((double)(num2 + i), listAutocorrelation[i]);
                series4.IsVisibleInLegend = false;
                form.chart1.Series.Add(series4);
                item.Points.AddXY((double)(num2 + i), listConfidenceLimit[i]);
                series2.Points.AddXY((double)(num2 + i), -listConfidenceLimit[i]);
                series3.Points.AddXY((double)i, 0.0);
            }
            form.chart1.Series.Add(item);
            form.chart1.Series.Add(series2);
            form.chart1.Series.Add(series3);
            form.Show();
        }
Esempio n. 6
0
        public static void DrawTwoSeriesData(List<double> firstSeries, int firstStartIndex, List<double> secondSeries, int secondStartIndex)
        {
            Plot_Form form = new Plot_Form();

            System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
            series1.ChartArea = "ChartArea1";
            series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
            series1.Color = System.Drawing.Color.Blue;
            series1.IsVisibleInLegend = false;

            System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
            series2.ChartArea = "ChartArea1";
            series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
            series2.Color = System.Drawing.Color.Red;
            series2.IsVisibleInLegend = false;

            form.chart1.ChartAreas[0].AxisX.Interval = Math.Ceiling(1.0 * (firstSeries.Count - firstStartIndex) / 20);
            form.chart1.Titles["Title1"].Text = "Time series";
            form.chart1.Series["Data"].Color = System.Drawing.Color.Blue;
            for (int i = firstStartIndex; i < firstSeries.Count; i++)
            {
                series1.Points.AddXY(i + 1, firstSeries[i]);
            }
            form.chart1.Series.Add(series1);

            for (int i = secondStartIndex; i < secondSeries.Count; i++)
            {
                series2.Points.AddXY(i + 1, secondSeries[i]);
            }
            form.chart1.Series.Add(series2);

            form.ShowDialog();
        }
Esempio n. 7
0
 public static void DrawSeriesData(List<double> series, int startIndex)
 {
     Plot_Form form = new Plot_Form();
     form.chart1.ChartAreas[0].AxisX.Interval = Math.Ceiling(1.0 * (series.Count - startIndex) / 20);
     form.chart1.Titles["Title1"].Text = "Time series";
     form.chart1.Series["Data"].Color = System.Drawing.Color.Blue;
     for (int i = startIndex; i < series.Count; i++)
     {
         form.chart1.Series["Data"].Points.AddXY(i + 1, series.ElementAt(i));
     }
     form.ShowDialog();
 }
Esempio n. 8
0
        public static void DrawAutocorrelation(List<double> listAutocorrelation, List<double> listConfidenceLimit, bool isPACF = false)
        {
            Plot_Form form = new Plot_Form();
            if (!isPACF)
            {
                form.chart1.Titles["Title1"].Text = "Autocorrelation Function";
                form.chart1.ChartAreas["ChartArea1"].Axes[0].Title = "Lag";
                form.chart1.ChartAreas["ChartArea1"].Axes[1].Title = "ACF";
                form.chart1.Series[0].Name = "ACF";
            }
            else
            {
                form.chart1.Titles["Title1"].Text = "Partial Autocorrelation Function";
                form.chart1.ChartAreas["ChartArea1"].Axes[0].Title = "Lag";
                form.chart1.ChartAreas["ChartArea1"].Axes[1].Title = "PACF";
                form.chart1.Series[0].Name = "PACF";
            }

            int numData = listAutocorrelation.Count;
            form.chart1.ChartAreas[0].AxisX.Interval = Math.Ceiling(1.0 * numData / 20);
            System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
            series1.ChartArea = "ChartArea1";
            series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
            series1.Color = System.Drawing.Color.Red;
            series1.IsVisibleInLegend = false;

            System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
            series2.ChartArea = "ChartArea1";
            series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
            series2.Color = System.Drawing.Color.Red;
            series2.IsVisibleInLegend = false;

            int start = 0;
            if (isPACF)
            {
                start = 1;
            }
            for (int i = 0; i < listAutocorrelation.Count; i++)
            {
                System.Windows.Forms.DataVisualization.Charting.Series series = new System.Windows.Forms.DataVisualization.Charting.Series();
                series.ChartArea = "ChartArea1";
                series.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
                series.Color = System.Drawing.Color.Blue;
                series.Points.AddXY(start + i, 0.0);
                series.Points.AddXY(start + i, listAutocorrelation[i]);
                series.IsVisibleInLegend = false;
                form.chart1.Series.Add(series);

                series1.Points.AddXY(start + i, listConfidenceLimit[i]);
                series2.Points.AddXY(start + i, -listConfidenceLimit[i]);
            }

            form.chart1.Series.Add(series1);
            form.chart1.Series.Add(series2);

            form.ShowDialog();
        }