Example #1
1
        private void Annotation_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            Chart1.Annotations.Clear();

            AnnotationStyle.Items.Clear();
            AnnotationStyle.Enabled = false;

            AnnotationStyle1.Items.Clear();
            AnnotationStyle1.Enabled = false;
            AnnotationStyle2.Items.Clear();
            AnnotationStyle2.Visible = false;

            if(Annotation.SelectedItem.ToString() == "Line")
            {
                LineAnnotation annotation = new LineAnnotation();
                annotation.AnchorDataPoint = Chart1.Series[0].Points[1];
                annotation.Height = -25;
                annotation.Width = -25;
                annotation.LineWidth = 2;

                Chart1.Annotations.Add(annotation);

                SetLineControls(true);

            }
            else if(Annotation.SelectedItem.ToString() == "Vertical Line")
            {
                VerticalLineAnnotation annotation = new VerticalLineAnnotation();
                annotation.AnchorDataPoint = Chart1.Series[0].Points[1];
                annotation.Height = -25;
                annotation.LineWidth = 2;

                Chart1.Annotations.Add(annotation);

                SetLineControls(true);

            }
            else if(Annotation.SelectedItem.ToString() == "Horizontal Line")
            {
                HorizontalLineAnnotation annotation = new HorizontalLineAnnotation();
                annotation.AnchorDataPoint = Chart1.Series[0].Points[1];
                annotation.Width = -25;
                annotation.LineWidth = 2;

                Chart1.Annotations.Add(annotation);

                SetLineControls(true);
            }
            else if(Annotation.SelectedItem.ToString() == "Polyline")
            {
                PolylineAnnotation annotation = new PolylineAnnotation();
                annotation.AnchorDataPoint = Chart1.Series[0].Points[1];

                // explicitly set the relative height and width
                annotation.Height = 50;
                annotation.Width = 30;

                PointF [] points = new PointF[5];
                points[0].X = 0;
                points[0].Y = 0;

                points[1].X = 100;
                points[1].Y = 0;

                points[2].X = 0;
                points[2].Y = 100;

                points[3].X = 100;
                points[3].Y = 100;

                points[4].X = 0;
                points[4].Y = 50;

                annotation.GraphicsPath.AddPolygon(points);

                Chart1.Annotations.Add(annotation);

                SetLineControls(false);
            }
            else if(Annotation.SelectedItem.ToString() == "Text")
            {
                TextAnnotation annotation = new TextAnnotation();
                annotation.AnchorDataPoint = Chart1.Series[0].Points[1];
                annotation.Text = "I am a TextAnnotation";
                annotation.ForeColor = Color.Black;
                annotation.Font = new Font("Arial", 12);;

                Chart1.Annotations.Add(annotation);
                SetTextControls();

            }
            else if(Annotation.SelectedItem.ToString() == "Rectangle")
            {
                RectangleAnnotation annotation = new RectangleAnnotation();
                annotation.AnchorDataPoint = Chart1.Series[0].Points[1];
                annotation.Text = "I am a\nRectangleAnnotation";
                annotation.ForeColor = Color.Black;
                annotation.Font = new Font("Arial", 12);;
                annotation.LineWidth = 2;

                Chart1.Annotations.Add(annotation);

                SetTextControls();
                SetColorLineControls();
                AnnotationStyle1.SelectedIndex = 2;
            }
            else if(Annotation.SelectedItem.ToString() == "Ellipse")
            {
                EllipseAnnotation annotation = new EllipseAnnotation();
                annotation.AnchorDataPoint = Chart1.Series[0].Points[1];
                annotation.Text = "I am an EllipseAnnotation";
                annotation.ForeColor = Color.Black;
                annotation.Font = new Font("Arial", 12);;
                annotation.LineWidth = 2;
                annotation.Height = 35;
                annotation.Width = 60;

                Chart1.Annotations.Add(annotation);

                SetTextControls();
                SetColorLineControls();
                AnnotationStyle1.SelectedIndex = 2;

            }
            else if(Annotation.SelectedItem.ToString() == "Arrow")
            {
                ArrowAnnotation annotation = new ArrowAnnotation();
                annotation.AnchorDataPoint = Chart1.Series[0].Points[1];
                annotation.Height = -25;
                annotation.Width = -25;
                annotation.LineWidth = 2;

                Chart1.Annotations.Add(annotation);

                SetArrowControls();

            }
            else if(Annotation.SelectedItem.ToString() == "Border3D")
            {
                Border3DAnnotation annotation = new Border3DAnnotation();
                annotation.AnchorDataPoint = Chart1.Series[0].Points[1];
                annotation.Text = "I am a Border3DAnnotation";
                annotation.ForeColor = Color.Black;
                annotation.Font = new Font("Arial", 12);
                annotation.Height = 40;
                annotation.Width = 50;

                Chart1.Annotations.Add(annotation);

                SetBorder3DControls();

            }
            else if(Annotation.SelectedItem.ToString() == "Callout")
            {
                CalloutAnnotation annotation = new CalloutAnnotation();
                annotation.AnchorDataPoint = Chart1.Series[0].Points[1];
                annotation.Text = "I am a\nCalloutAnnotation";
                annotation.ForeColor = Color.Black;
                annotation.Font = new Font("Arial", 10);;
                annotation.Height = 35;
                annotation.Width = 50;

                Chart1.Annotations.Add(annotation);

                SetCalloutControls();

            }
            else if(Annotation.SelectedItem.ToString() == "Polygon")
            {
                PolygonAnnotation annotation = new PolygonAnnotation();
                annotation.AnchorDataPoint = Chart1.Series[0].Points[1];

                // explicitly set the relative height and width
                annotation.Height = 50;
                annotation.Width = 30;

                annotation.BackColor = Color.FromArgb(128, Color.Orange);

                // define relative value points for a polygon
                PointF [] points = new PointF[5];
                points[0].X = 0;
                points[0].Y = 0;

                points[1].X = 100;
                points[1].Y = 0;

                points[2].X = 100;
                points[2].Y = 100;

                points[3].X = 0;
                points[3].Y = 100;

                points[4].X = 50;
                points[4].Y = 50;

                annotation.GraphicsPath.AddPolygon(points);

                Chart1.Annotations.Add(annotation);

                SetColorControl();
                SetColorLineControls();

            }
            else if(Annotation.SelectedItem.ToString() == "Image")
            {
                if(Chart1.Images.IndexOf("MyBmp") < 0)
                {
                    Bitmap Bmp = new Bitmap(200, 75);
                    Graphics g = Graphics.FromImage(Bmp);
                    g.FillRectangle(new SolidBrush(Color.Transparent), 0, 0, Bmp.Width, Bmp.Height);
                    g.FillRectangle(new SolidBrush(Color.PaleGoldenrod), Bmp.Width/2, 0, Bmp.Width/2, Bmp.Height);
                    g.FillRectangle(new SolidBrush(Color.PaleVioletRed), 0, 0, Bmp.Width/2, Bmp.Height);
                    g.FillRectangle(new SolidBrush(Color.FromArgb(128, Color.DarkOrange)), 0, Bmp.Height/2, Bmp.Width, Bmp.Height/2);
                    g.DrawString("I am an ImageAnnotation", new Font("Arial", 12),
                        new SolidBrush(Color.Black),
                        new Rectangle( 0, 0, Bmp.Width, Bmp.Height));

                    g.Dispose();

                    Chart1.Images.Add(new NamedImage("MyBmp", Bmp));
                }

                ImageAnnotation annotation = new ImageAnnotation();
                annotation.AnchorDataPoint = Chart1.Series[0].Points[1];
                annotation.Image = "MyBmp";

                Chart1.Annotations.Add(annotation);
                StyleLabel1.Text = "";
                StyleLabel2.Text = "";
            }
        }
Example #2
0
        private void AddLineAnnotation()
        {
            // create a line annotation
            LineAnnotation annotation = new LineAnnotation();

            // setup visual attributes
            annotation.StartCap = LineAnchorCapStyle.Arrow;
            annotation.EndCap = LineAnchorCapStyle.Arrow;
            annotation.LineWidth = 3;
            annotation.LineColor = Color.OrangeRed;
            annotation.ShadowOffset = 2;
            annotation.ClipToChartArea = "Default";

            // prevent moving or selecting
            annotation.AllowMoving = false;
            annotation.AllowAnchorMoving = false;
            annotation.AllowSelecting = false;

            if(Chart1.Series[0].Points.Count > 10)
            {
                // Use the Anchor Method to anchor to points 8 and 10...
                annotation.SetAnchor(Chart1.Series[0].Points[8], Chart1.Series[0].Points[10]);
            }

            // add the annotation to the collection
            Chart1.Annotations.Add(annotation);
        }
        /// <summary>
        /// Draw a line on chart.
        /// </summary>
        /// <param name="sender">Source Chart.</param>
        /// <param name="x0">First point on XAxis.</param>
        /// <param name="x1">Second piont on XAxis.</param>
        /// <param name="y0">First point on YAxis.</param>
        /// <param name="y1">Second point on YAxis.</param>
        /// <param name="lineColor">Outline color.</param>
        /// <param name="name">Annotation name.</param>
        /// <param name="lineWidth">Line width</param>
        /// <param name="lineStyle">Line style</param>
        public static void DrawLine(this Chart sender, double x0, double x1,
            double y0, double y1, Drawing.Color lineColor, string name = "",
            int lineWidth = 1, ChartDashStyle lineStyle = ChartDashStyle.Solid)
        {
            LineAnnotation line = new LineAnnotation();
            string chartAreaName = sender.ChartAreas[0].Name;
            line.ClipToChartArea = chartAreaName;
            line.AxisXName = chartAreaName + "\\rX";
            line.YAxisName = chartAreaName + "\\rY";
            line.IsSizeAlwaysRelative = false;

            line.X = x0;
            line.Y = y0;
            line.Height = y1 - y0;
            line.Width = x1 - x0;
            line.LineColor = lineColor;
            line.LineWidth = lineWidth;
            line.LineDashStyle = lineStyle;
            sender.Annotations.Add(line);

            if (!string.IsNullOrEmpty(name)) line.Name = name;
        }
Example #4
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
     System.Windows.Forms.DataVisualization.Charting.LineAnnotation lineAnnotation2 = new System.Windows.Forms.DataVisualization.Charting.LineAnnotation();
     System.Windows.Forms.DataVisualization.Charting.ChartArea      chartArea2      = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
     System.Windows.Forms.DataVisualization.Charting.Legend         legend2         = new System.Windows.Forms.DataVisualization.Charting.Legend();
     System.Windows.Forms.DataVisualization.Charting.Series         series2         = new System.Windows.Forms.DataVisualization.Charting.Series();
     System.Windows.Forms.DataVisualization.Charting.Title          title2          = new System.Windows.Forms.DataVisualization.Charting.Title();
     this.loadPricesButton   = new System.Windows.Forms.Button();
     this.notifyIcon1        = new System.Windows.Forms.NotifyIcon(this.components);
     this.showValues         = new System.Windows.Forms.CheckBox();
     this.tabControl1        = new System.Windows.Forms.TabControl();
     this.tabPage1           = new System.Windows.Forms.TabPage();
     this.chart              = new System.Windows.Forms.DataVisualization.Charting.Chart();
     this.tabPage2           = new System.Windows.Forms.TabPage();
     this.label2             = new System.Windows.Forms.Label();
     this.label1             = new System.Windows.Forms.Label();
     this.minSavePercTextBox = new System.Windows.Forms.TextBox();
     this.tabPage3           = new System.Windows.Forms.TabPage();
     this.configurationTab   = new System.Windows.Forms.TextBox();
     this.tabPage4           = new System.Windows.Forms.TabPage();
     this.statsBox           = new System.Windows.Forms.RichTextBox();
     this.statusLabel        = new System.Windows.Forms.Label();
     this.button3            = new System.Windows.Forms.Button();
     this.button2            = new System.Windows.Forms.Button();
     this.buttonExecute      = new System.Windows.Forms.Button();
     this.loadTAButton       = new System.Windows.Forms.Button();
     this.timeFast           = new System.Windows.Forms.Timer(this.components);
     this.debugView          = new System.Windows.Forms.ListBox();
     this.funcListLabel      = new System.Windows.Forms.TextBox();
     this.nodelayCheckbox    = new System.Windows.Forms.CheckBox();
     this.tabControl1.SuspendLayout();
     this.tabPage1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
     this.tabPage2.SuspendLayout();
     this.tabPage3.SuspendLayout();
     this.tabPage4.SuspendLayout();
     this.SuspendLayout();
     //
     // loadPricesButton
     //
     this.loadPricesButton.AllowDrop             = true;
     this.loadPricesButton.AutoSizeMode          = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
     this.loadPricesButton.BackColor             = System.Drawing.SystemColors.Menu;
     this.loadPricesButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
     this.loadPricesButton.Cursor = System.Windows.Forms.Cursors.Arrow;
     this.loadPricesButton.FlatAppearance.BorderColor        = System.Drawing.Color.DimGray;
     this.loadPricesButton.FlatAppearance.BorderSize         = 2;
     this.loadPricesButton.FlatAppearance.CheckedBackColor   = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
     this.loadPricesButton.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Cyan;
     this.loadPricesButton.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
     this.loadPricesButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.loadPricesButton.Font      = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
     this.loadPricesButton.ForeColor = System.Drawing.Color.Navy;
     this.loadPricesButton.Location  = new System.Drawing.Point(611, 29);
     this.loadPricesButton.Margin    = new System.Windows.Forms.Padding(7);
     this.loadPricesButton.Name      = "loadPricesButton";
     this.loadPricesButton.Size      = new System.Drawing.Size(103, 30);
     this.loadPricesButton.TabIndex  = 0;
     this.loadPricesButton.Text      = "load prices";
     this.loadPricesButton.UseVisualStyleBackColor = false;
     this.loadPricesButton.Click += new System.EventHandler(this.LoadPricesButtonClick);
     //
     // notifyIcon1
     //
     this.notifyIcon1.BalloonTipIcon    = System.Windows.Forms.ToolTipIcon.Info;
     this.notifyIcon1.BalloonTipText    = "ef vf df dd fg";
     this.notifyIcon1.BalloonTipTitle   = "d gfhth rhgh";
     this.notifyIcon1.Icon              = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon")));
     this.notifyIcon1.Text              = "notifyIcon1";
     this.notifyIcon1.Visible           = true;
     this.notifyIcon1.MouseClick       += new System.Windows.Forms.MouseEventHandler(this.TrayClick);
     this.notifyIcon1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.NotifyIcon1MouseDoubleClick);
     //
     // showValues
     //
     this.showValues.AutoSize              = true;
     this.showValues.BackColor             = System.Drawing.Color.RoyalBlue;
     this.showValues.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
     this.showValues.Cursor    = System.Windows.Forms.Cursors.Hand;
     this.showValues.ForeColor = System.Drawing.Color.OldLace;
     this.showValues.Location  = new System.Drawing.Point(143, 24);
     this.showValues.Margin    = new System.Windows.Forms.Padding(0);
     this.showValues.Name      = "showValues";
     this.showValues.Size      = new System.Drawing.Size(83, 20);
     this.showValues.TabIndex  = 1;
     this.showValues.Text      = "showValues";
     this.showValues.UseVisualStyleBackColor = false;
     this.showValues.CheckedChanged         += new System.EventHandler(this.CheckBox1CheckedChanged);
     //
     // tabControl1
     //
     this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                     | System.Windows.Forms.AnchorStyles.Left)));
     this.tabControl1.Controls.Add(this.tabPage1);
     this.tabControl1.Controls.Add(this.tabPage2);
     this.tabControl1.Controls.Add(this.tabPage3);
     this.tabControl1.Controls.Add(this.tabPage4);
     this.tabControl1.Font          = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
     this.tabControl1.Location      = new System.Drawing.Point(1, 0);
     this.tabControl1.Margin        = new System.Windows.Forms.Padding(9);
     this.tabControl1.Name          = "tabControl1";
     this.tabControl1.Padding       = new System.Drawing.Point(9, 3);
     this.tabControl1.SelectedIndex = 0;
     this.tabControl1.Size          = new System.Drawing.Size(609, 464);
     this.tabControl1.TabIndex      = 2;
     //
     // tabPage1
     //
     this.tabPage1.BackColor             = System.Drawing.SystemColors.Control;
     this.tabPage1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
     this.tabPage1.BorderStyle           = System.Windows.Forms.BorderStyle.FixedSingle;
     this.tabPage1.Controls.Add(this.chart);
     this.tabPage1.Location = new System.Drawing.Point(4, 25);
     this.tabPage1.Name     = "tabPage1";
     this.tabPage1.Padding  = new System.Windows.Forms.Padding(3);
     this.tabPage1.Size     = new System.Drawing.Size(601, 435);
     this.tabPage1.TabIndex = 0;
     this.tabPage1.Text     = "Preload";
     //
     // chart
     //
     lineAnnotation2.Name = "LineAnnotation1";
     this.chart.Annotations.Add(lineAnnotation2);
     this.chart.AntiAliasing                         = System.Windows.Forms.DataVisualization.Charting.AntiAliasingStyles.Graphics;
     this.chart.BackColor                            = System.Drawing.Color.Ivory;
     this.chart.BackGradientStyle                    = System.Windows.Forms.DataVisualization.Charting.GradientStyle.Center;
     this.chart.BackgroundImageLayout                = System.Windows.Forms.ImageLayout.Center;
     this.chart.BackImageAlignment                   = System.Windows.Forms.DataVisualization.Charting.ChartImageAlignmentStyle.Bottom;
     this.chart.BackImageTransparentColor            = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));
     this.chart.BackSecondaryColor                   = System.Drawing.Color.Transparent;
     this.chart.BorderlineColor                      = System.Drawing.Color.OrangeRed;
     this.chart.BorderlineDashStyle                  = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Dash;
     this.chart.BorderlineWidth                      = 4;
     this.chart.BorderSkin.BackColor                 = System.Drawing.Color.Maroon;
     this.chart.BorderSkin.BackGradientStyle         = System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom;
     this.chart.BorderSkin.BackHatchStyle            = System.Windows.Forms.DataVisualization.Charting.ChartHatchStyle.Cross;
     this.chart.BorderSkin.BackImageAlignment        = System.Windows.Forms.DataVisualization.Charting.ChartImageAlignmentStyle.Center;
     this.chart.BorderSkin.BackImageTransparentColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
     this.chart.BorderSkin.BackSecondaryColor        = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
     this.chart.BorderSkin.BorderColor               = System.Drawing.Color.MediumBlue;
     this.chart.BorderSkin.BorderDashStyle           = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.DashDot;
     this.chart.BorderSkin.BorderWidth               = 3;
     this.chart.BorderSkin.PageColor                 = System.Drawing.Color.Turquoise;
     this.chart.BorderSkin.SkinStyle                 = System.Windows.Forms.DataVisualization.Charting.BorderSkinStyle.Emboss;
     chartArea2.Area3DStyle.IsRightAngleAxes         = false;
     chartArea2.Area3DStyle.LightStyle               = System.Windows.Forms.DataVisualization.Charting.LightStyle.Realistic;
     chartArea2.Area3DStyle.WallWidth                = 0;
     chartArea2.AxisX.ArrowStyle                     = System.Windows.Forms.DataVisualization.Charting.AxisArrowStyle.Lines;
     chartArea2.AxisX.LineDashStyle                  = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Dash;
     chartArea2.AxisX.ScaleView.MinSizeType          = System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Number;
     chartArea2.BackGradientStyle                    = System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom;
     chartArea2.BackHatchStyle                       = System.Windows.Forms.DataVisualization.Charting.ChartHatchStyle.DarkDownwardDiagonal;
     chartArea2.BackImageAlignment                   = System.Windows.Forms.DataVisualization.Charting.ChartImageAlignmentStyle.Top;
     chartArea2.Name = "ChartArea1";
     this.chart.ChartAreas.Add(chartArea2);
     this.chart.Cursor          = System.Windows.Forms.Cursors.Default;
     this.chart.ImeMode         = System.Windows.Forms.ImeMode.NoControl;
     legend2.BackImageWrapMode  = System.Windows.Forms.DataVisualization.Charting.ChartImageWrapMode.Unscaled;
     legend2.BackSecondaryColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
     legend2.BorderColor        = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
     legend2.BorderDashStyle    = System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Dash;
     legend2.BorderWidth        = 5;
     legend2.Font          = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     legend2.IsTextAutoFit = false;
     legend2.Name          = "xxx";
     legend2.TitleFont     = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.chart.Legends.Add(legend2);
     this.chart.Location     = new System.Drawing.Point(-2, 6);
     this.chart.Margin       = new System.Windows.Forms.Padding(0);
     this.chart.Name         = "chart";
     this.chart.Palette      = System.Windows.Forms.DataVisualization.Charting.ChartColorPalette.Bright;
     series2.ChartArea       = "ChartArea1";
     series2.ChartType       = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
     series2.Legend          = "xxx";
     series2.Name            = "Series1";
     series2.YValuesPerPoint = 6;
     this.chart.Series.Add(series2);
     this.chart.Size     = new System.Drawing.Size(594, 432);
     this.chart.TabIndex = 5;
     this.chart.Text     = "chart1";
     this.chart.TextAntiAliasingQuality = System.Windows.Forms.DataVisualization.Charting.TextAntiAliasingQuality.SystemDefault;
     title2.Name = "Title1";
     this.chart.Titles.Add(title2);
     this.chart.PostPaint += new System.EventHandler <System.Windows.Forms.DataVisualization.Charting.ChartPaintEventArgs>(this.Chart_PostPaint);
     this.chart.Click     += new System.EventHandler(this.ChartClick);
     //
     // tabPage2
     //
     this.tabPage2.BackColor             = System.Drawing.SystemColors.ButtonShadow;
     this.tabPage2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
     this.tabPage2.BorderStyle           = System.Windows.Forms.BorderStyle.FixedSingle;
     this.tabPage2.Controls.Add(this.label2);
     this.tabPage2.Controls.Add(this.label1);
     this.tabPage2.Controls.Add(this.minSavePercTextBox);
     this.tabPage2.Controls.Add(this.showValues);
     this.tabPage2.Location = new System.Drawing.Point(4, 25);
     this.tabPage2.Name     = "tabPage2";
     this.tabPage2.Padding  = new System.Windows.Forms.Padding(3);
     this.tabPage2.Size     = new System.Drawing.Size(601, 435);
     this.tabPage2.TabIndex = 1;
     this.tabPage2.Text     = "options";
     //
     // label2
     //
     this.label2.AutoSize = true;
     this.label2.Font     = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label2.Location = new System.Drawing.Point(26, 24);
     this.label2.Name     = "label2";
     this.label2.Size     = new System.Drawing.Size(112, 17);
     this.label2.TabIndex = 4;
     this.label2.Text     = "Show input values";
     //
     // label1
     //
     this.label1.AutoSize = true;
     this.label1.Font     = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label1.Location = new System.Drawing.Point(1, 56);
     this.label1.Name     = "label1";
     this.label1.Size     = new System.Drawing.Size(139, 17);
     this.label1.TabIndex = 3;
     this.label1.Text     = "MinSaveHitPercent (%)";
     //
     // minSavePercTextBox
     //
     this.minSavePercTextBox.BackColor    = System.Drawing.SystemColors.MenuHighlight;
     this.minSavePercTextBox.BorderStyle  = System.Windows.Forms.BorderStyle.FixedSingle;
     this.minSavePercTextBox.Cursor       = System.Windows.Forms.Cursors.UpArrow;
     this.minSavePercTextBox.ForeColor    = System.Drawing.SystemColors.Info;
     this.minSavePercTextBox.Location     = new System.Drawing.Point(143, 54);
     this.minSavePercTextBox.Name         = "minSavePercTextBox";
     this.minSavePercTextBox.Size         = new System.Drawing.Size(100, 20);
     this.minSavePercTextBox.TabIndex     = 2;
     this.minSavePercTextBox.Text         = "86";
     this.minSavePercTextBox.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
     //
     // tabPage3
     //
     this.tabPage3.BackColor       = System.Drawing.Color.Maroon;
     this.tabPage3.BackgroundImage = global::FinancePermutator.Properties.Resources._86015670;
     this.tabPage3.Controls.Add(this.configurationTab);
     this.tabPage3.Location = new System.Drawing.Point(4, 25);
     this.tabPage3.Name     = "tabPage3";
     this.tabPage3.Padding  = new System.Windows.Forms.Padding(3);
     this.tabPage3.Size     = new System.Drawing.Size(601, 435);
     this.tabPage3.TabIndex = 2;
     this.tabPage3.Text     = "configuration";
     this.tabPage3.UseVisualStyleBackColor = true;
     //
     // configurationTab
     //
     this.configurationTab.AcceptsReturn  = true;
     this.configurationTab.AcceptsTab     = true;
     this.configurationTab.AccessibleRole = System.Windows.Forms.AccessibleRole.Table;
     this.configurationTab.BackColor      = System.Drawing.Color.LightSteelBlue;
     this.configurationTab.BorderStyle    = System.Windows.Forms.BorderStyle.FixedSingle;
     this.configurationTab.Font           = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.configurationTab.ForeColor      = System.Drawing.Color.DarkSlateBlue;
     this.configurationTab.ImeMode        = System.Windows.Forms.ImeMode.NoControl;
     this.configurationTab.Location       = new System.Drawing.Point(0, 0);
     this.configurationTab.Margin         = new System.Windows.Forms.Padding(0);
     this.configurationTab.Multiline      = true;
     this.configurationTab.Name           = "configurationTab";
     this.configurationTab.ScrollBars     = System.Windows.Forms.ScrollBars.Vertical;
     this.configurationTab.Size           = new System.Drawing.Size(598, 432);
     this.configurationTab.TabIndex       = 0;
     this.configurationTab.Text           = resources.GetString("configurationTab.Text");
     //
     // tabPage4
     //
     this.tabPage4.BackColor             = System.Drawing.Color.CornflowerBlue;
     this.tabPage4.BackgroundImage       = global::FinancePermutator.Properties.Resources.nuke;
     this.tabPage4.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
     this.tabPage4.BorderStyle           = System.Windows.Forms.BorderStyle.FixedSingle;
     this.tabPage4.Controls.Add(this.statsBox);
     this.tabPage4.Font        = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.tabPage4.ForeColor   = System.Drawing.SystemColors.Info;
     this.tabPage4.Location    = new System.Drawing.Point(4, 25);
     this.tabPage4.Name        = "tabPage4";
     this.tabPage4.Padding     = new System.Windows.Forms.Padding(3);
     this.tabPage4.RightToLeft = System.Windows.Forms.RightToLeft.No;
     this.tabPage4.Size        = new System.Drawing.Size(601, 435);
     this.tabPage4.TabIndex    = 3;
     this.tabPage4.Text        = "stats";
     //
     // statsBox
     //
     this.statsBox.BackColor = System.Drawing.SystemColors.GrayText;
     this.statsBox.Font      = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.statsBox.ForeColor = System.Drawing.Color.Azure;
     this.statsBox.Location  = new System.Drawing.Point(4, 3);
     this.statsBox.Name      = "statsBox";
     this.statsBox.Size      = new System.Drawing.Size(587, 424);
     this.statsBox.TabIndex  = 0;
     this.statsBox.Text      = "Networks done: 2\nSuccess: 0\nNumber of broken data: 3\nBad networks: 1";
     //
     // statusLabel
     //
     this.statusLabel.BackColor   = System.Drawing.Color.LightGoldenrodYellow;
     this.statusLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
     this.statusLabel.FlatStyle   = System.Windows.Forms.FlatStyle.System;
     this.statusLabel.Font        = new System.Drawing.Font("Lucida Console", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
     this.statusLabel.ForeColor   = System.Drawing.Color.MidnightBlue;
     this.statusLabel.Location    = new System.Drawing.Point(10, 473);
     this.statusLabel.MaximumSize = new System.Drawing.Size(0, 19);
     this.statusLabel.MinimumSize = new System.Drawing.Size(800, 0);
     this.statusLabel.Name        = "statusLabel";
     this.statusLabel.Size        = new System.Drawing.Size(800, 19);
     this.statusLabel.TabIndex    = 6;
     this.statusLabel.Text        = "idle";
     //
     // button3
     //
     this.button3.BackColor    = System.Drawing.SystemColors.ButtonFace;
     this.button3.Cursor       = System.Windows.Forms.Cursors.Hand;
     this.button3.DialogResult = System.Windows.Forms.DialogResult.OK;
     this.button3.FlatAppearance.BorderColor        = System.Drawing.Color.DimGray;
     this.button3.FlatAppearance.BorderSize         = 2;
     this.button3.FlatAppearance.CheckedBackColor   = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
     this.button3.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Cyan;
     this.button3.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
     this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.button3.Font      = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
     this.button3.ForeColor = System.Drawing.Color.Navy;
     this.button3.Location  = new System.Drawing.Point(611, 171);
     this.button3.Name      = "button3";
     this.button3.Size      = new System.Drawing.Size(103, 35);
     this.button3.TabIndex  = 4;
     this.button3.Text      = "clear log";
     this.button3.UseVisualStyleBackColor = false;
     this.button3.Click += new System.EventHandler(this.ExecuteButtonClick);
     //
     // button2
     //
     this.button2.BackColor = System.Drawing.SystemColors.ButtonFace;
     this.button2.Cursor    = System.Windows.Forms.Cursors.Hand;
     this.button2.FlatAppearance.BorderColor        = System.Drawing.Color.DimGray;
     this.button2.FlatAppearance.BorderSize         = 2;
     this.button2.FlatAppearance.CheckedBackColor   = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
     this.button2.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Cyan;
     this.button2.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
     this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.button2.Font      = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
     this.button2.ForeColor = System.Drawing.Color.Navy;
     this.button2.Location  = new System.Drawing.Point(611, 136);
     this.button2.Name      = "button2";
     this.button2.Size      = new System.Drawing.Size(103, 29);
     this.button2.TabIndex  = 3;
     this.button2.Text      = "clear";
     this.button2.UseVisualStyleBackColor = false;
     this.button2.Click += new System.EventHandler(this.CreateNetworkButtonClick);
     //
     // buttonExecute
     //
     this.buttonExecute.BackColor = System.Drawing.SystemColors.ButtonFace;
     this.buttonExecute.Cursor    = System.Windows.Forms.Cursors.Hand;
     this.buttonExecute.Enabled   = false;
     this.buttonExecute.FlatAppearance.BorderColor        = System.Drawing.Color.DimGray;
     this.buttonExecute.FlatAppearance.BorderSize         = 2;
     this.buttonExecute.FlatAppearance.CheckedBackColor   = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
     this.buttonExecute.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Cyan;
     this.buttonExecute.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
     this.buttonExecute.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.buttonExecute.Font      = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
     this.buttonExecute.ForeColor = System.Drawing.Color.Navy;
     this.buttonExecute.Location  = new System.Drawing.Point(611, 103);
     this.buttonExecute.Name      = "buttonExecute";
     this.buttonExecute.Size      = new System.Drawing.Size(103, 28);
     this.buttonExecute.TabIndex  = 2;
     this.buttonExecute.Text      = "execute";
     this.buttonExecute.UseVisualStyleBackColor = false;
     this.buttonExecute.Click += new System.EventHandler(this.GenerateTrainButtonClick);
     //
     // loadTAButton
     //
     this.loadTAButton.AllowDrop    = true;
     this.loadTAButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
     this.loadTAButton.BackColor    = System.Drawing.SystemColors.Control;
     this.loadTAButton.Cursor       = System.Windows.Forms.Cursors.Hand;
     this.loadTAButton.FlatAppearance.BorderColor        = System.Drawing.Color.DimGray;
     this.loadTAButton.FlatAppearance.BorderSize         = 2;
     this.loadTAButton.FlatAppearance.CheckedBackColor   = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
     this.loadTAButton.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Cyan;
     this.loadTAButton.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
     this.loadTAButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.loadTAButton.Font      = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
     this.loadTAButton.ForeColor = System.Drawing.Color.Navy;
     this.loadTAButton.Location  = new System.Drawing.Point(611, 67);
     this.loadTAButton.Margin    = new System.Windows.Forms.Padding(7);
     this.loadTAButton.Name      = "loadTAButton";
     this.loadTAButton.Size      = new System.Drawing.Size(103, 30);
     this.loadTAButton.TabIndex  = 1;
     this.loadTAButton.Text      = "load talib";
     this.loadTAButton.UseVisualStyleBackColor = false;
     this.loadTAButton.Click += new System.EventHandler(this.LoadTaLib);
     //
     // timeFast
     //
     this.timeFast.Enabled  = true;
     this.timeFast.Interval = 750;
     this.timeFast.Tick    += new System.EventHandler(this.TimeFastTick);
     //
     // debugView
     //
     this.debugView.BackColor           = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
     this.debugView.BorderStyle         = System.Windows.Forms.BorderStyle.FixedSingle;
     this.debugView.DrawMode            = System.Windows.Forms.DrawMode.OwnerDrawFixed;
     this.debugView.Font                = new System.Drawing.Font("DejaVu Sans Mono", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
     this.debugView.ForeColor           = System.Drawing.Color.DarkOliveGreen;
     this.debugView.HorizontalScrollbar = true;
     this.debugView.ItemHeight          = 11;
     this.debugView.Items.AddRange(new object[] {
         "Functions:",
         " Atan ",
         "  arg 0 startIdx: 0 ",
         "  arg 1 endIdx: 7 ",
         "  arg 2 inReal: System.Double[] %Close% 8",
         "  arg 3 outBegIdx: 0 ",
         "  arg 4 outNBElement: 0 ",
         "  arg 5 outReal: System.Double[] ",
         " Tan ",
         "  arg 0 startIdx: 0 ",
         "  arg 1 endIdx: 7 ",
         "  arg 2 inReal: System.Double[] %Open% 8",
         "  arg 3 outBegIdx: 0 ",
         "  arg 4 outNBElement: 0 ",
         "  arg 5 outReal: System.Double[] ",
         "",
         "InputDimension: 13"
     });
     this.debugView.Location            = new System.Drawing.Point(717, 22);
     this.debugView.Margin              = new System.Windows.Forms.Padding(0);
     this.debugView.Name                = "debugView";
     this.debugView.ScrollAlwaysVisible = true;
     this.debugView.Size                = new System.Drawing.Size(695, 431);
     this.debugView.TabIndex            = 3;
     this.debugView.DrawItem           += new System.Windows.Forms.DrawItemEventHandler(this.DebugView_Draw);
     //
     // funcListLabel
     //
     this.funcListLabel.BackColor   = System.Drawing.SystemColors.ButtonFace;
     this.funcListLabel.BorderStyle = System.Windows.Forms.BorderStyle.None;
     this.funcListLabel.Cursor      = System.Windows.Forms.Cursors.Default;
     this.funcListLabel.Font        = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
     this.funcListLabel.ForeColor   = System.Drawing.Color.Blue;
     this.funcListLabel.Location    = new System.Drawing.Point(611, 473);
     this.funcListLabel.Margin      = new System.Windows.Forms.Padding(0);
     this.funcListLabel.MaximumSize = new System.Drawing.Size(800, 999);
     this.funcListLabel.MinimumSize = new System.Drawing.Size(800, 12);
     this.funcListLabel.Name        = "funcListLabel";
     this.funcListLabel.Size        = new System.Drawing.Size(800, 15);
     this.funcListLabel.TabIndex    = 5;
     this.funcListLabel.Text        = "conmtraimer";
     this.funcListLabel.TextAlign   = System.Windows.Forms.HorizontalAlignment.Center;
     this.funcListLabel.WordWrap    = false;
     //
     // nodelayCheckbox
     //
     this.nodelayCheckbox.AutoSize = true;
     this.nodelayCheckbox.Font     = new System.Drawing.Font("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
     this.nodelayCheckbox.Location = new System.Drawing.Point(621, 212);
     this.nodelayCheckbox.Name     = "nodelayCheckbox";
     this.nodelayCheckbox.Size     = new System.Drawing.Size(68, 20);
     this.nodelayCheckbox.TabIndex = 6;
     this.nodelayCheckbox.Text     = "no delay";
     this.nodelayCheckbox.UseVisualStyleBackColor = true;
     //
     // Form1
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.AutoSize            = true;
     this.BackColor           = System.Drawing.SystemColors.Menu;
     this.BackgroundImage     = global::FinancePermutator.Properties.Resources.nicebg;
     this.ClientSize          = new System.Drawing.Size(1421, 500);
     this.Controls.Add(this.statusLabel);
     this.Controls.Add(this.nodelayCheckbox);
     this.Controls.Add(this.funcListLabel);
     this.Controls.Add(this.button3);
     this.Controls.Add(this.debugView);
     this.Controls.Add(this.button2);
     this.Controls.Add(this.tabControl1);
     this.Controls.Add(this.buttonExecute);
     this.Controls.Add(this.loadPricesButton);
     this.Controls.Add(this.loadTAButton);
     this.DoubleBuffered  = true;
     this.Font            = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
     this.Name            = "Form1";
     this.ShowIcon        = false;
     this.StartPosition   = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text            = "Form1";
     this.Load           += new System.EventHandler(this.Form1_Load);
     this.Paint          += new System.Windows.Forms.PaintEventHandler(this.Form1_Paint);
     this.Resize         += new System.EventHandler(this.Form1Resize);
     this.tabControl1.ResumeLayout(false);
     this.tabPage1.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
     this.tabPage2.ResumeLayout(false);
     this.tabPage2.PerformLayout();
     this.tabPage3.ResumeLayout(false);
     this.tabPage3.PerformLayout();
     this.tabPage4.ResumeLayout(false);
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Example #5
0
 private void DrawAnnotation(string chartarea, int x, int y)
 {
     this.CurrentLine = new LineAnnotation();
     this.CurrentLine.LineColor = this.CurrentColor;
     do
     {
         this.CurrentLine.Name = RandomHelper.Next().ToString();
     }
     while (!this.MainChart.Annotations.IsUniqueName(this.CurrentLine.Name));
     this.CurrentLine.LineWidth = 2;
     this.CurrentLine.ClipToChartArea = chartarea;
     this.CurrentLine.AxisX = this.MainChart.ChartAreas[chartarea].AxisX;
     this.CurrentLine.AxisY = this.MainChart.ChartAreas[chartarea].AxisY;
     this.CurrentLine.AllowAnchorMoving = true;
     this.CurrentLine.AllowMoving = true;
     this.CurrentLine.AllowPathEditing = true;
     this.CurrentLine.AllowResizing = true;
     this.CurrentLine.AllowSelecting = true;
     this.CurrentLine.IsSizeAlwaysRelative = false;
     this.CurrentLine.X = this.MainChart.ChartAreas[chartarea].AxisX.PixelPositionToValue((double)x);
     this.CurrentLine.Y = this.MainChart.ChartAreas[chartarea].AxisY.PixelPositionToValue((double)y);
     this.CurrentLine.Right = this.MainChart.ChartAreas[0].AxisX.PixelPositionToValue((double)x);
     this.CurrentLine.Bottom = this.MainChart.ChartAreas[0].AxisY.PixelPositionToValue((double)y);
     this.CurrentLine.Tag = Tuple.Create<int, int>(x, y);
     this.MainChart.Annotations.Add(this.CurrentLine);
 }
Example #6
0
 private void MainChart_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     if (this.CurrentLine != null && e.X != ((Tuple<int, int>)this.CurrentLine.Tag).Item1 && e.Y != ((Tuple<int, int>)this.CurrentLine.Tag).Item2)
     {
         this.CurrentLine.IsInfinitive = true;
         this.CurrentLine = null;
     }
 }
Example #7
0
 private void MainChart_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     this.MainChart.Focus();
     if (e.Button != System.Windows.Forms.MouseButtons.Right || this.MainChart.HitTest(e.X, e.Y).ChartArea == null)
     {
         if (e.Button == System.Windows.Forms.MouseButtons.Left && e.Clicks == 2)
         {
             LineAnnotation lineAnnotation = this.MainChart.HitTest(e.X, e.Y).Object as LineAnnotation;
             if (lineAnnotation != null)
             {
                 lineAnnotation.IsInfinitive = !lineAnnotation.IsInfinitive;
             }
         }
         return;
     }
     if (this.CurrentLine == null)
     {
         this.DrawAnnotation(this.MainChart.HitTest(e.X, e.Y).ChartArea.Name, e.X, e.Y);
         return;
     }
     this.CurrentLine.IsInfinitive = true;
     this.CurrentLine = null;
 }
Example #8
0
        /// <summary>
        /// Function to add a line annotation to the desired chart in the format which is followed by
        /// all the line annotations in this add-on.
        /// </summary>
        /// <param name="AxisX">X-Axis that the line annotation is to use for co-ordinates.</param>
        /// <param name="AxisY">Y-Axis that the line annotation is to use for co-ordinates.</param>
        /// <param name="X">X value for the start of the line.</param>
        /// <param name="Y">Y value for the start of the line.</param>
        /// <param name="Width">Width of the line.</param>
        /// <param name="Height">Height of the line.</param>
        /// <param name="output">The chart that the line annotation is being added to.</param>
        private void addLineAnnotation(Axis AxisX, Axis AxisY, double X, double Y, double Width, double Height, Chart output)
        {
            //Create a new line annotation.
            LineAnnotation lineAnnotation = new LineAnnotation();

            //Set each property to the parameters passed in.
            lineAnnotation.AxisX = AxisX;
            lineAnnotation.AxisY = AxisY;
            lineAnnotation.Y = Y;
            lineAnnotation.X = X;
            lineAnnotation.Height = Height;
            lineAnnotation.Width = Width;

            //Turn off relative size to get graph-oriented co-ordinates and set the line color.
            lineAnnotation.IsSizeAlwaysRelative = false;
            lineAnnotation.LineColor = myLineColor;

            //Add the annotation to the chart.
            output.Annotations.Add(lineAnnotation);
        }