Ejemplo n.º 1
0
        void SetupTChartTools()
        {
            chart.Tools.Clear();
            Steema.TeeChart.Tools.MarksTip marksTip1 = new Steema.TeeChart.Tools.MarksTip();
            marksTip1.Style    = Steema.TeeChart.Styles.MarksStyles.XY;
            marksTip1.GetText += new Steema.TeeChart.Tools.MarksTipGetTextEventHandler(this.marksTip1_GetText);
            chart.Tools.Add(marksTip1);

            if (graphDef == null)
            {
                return;
            }
            if (m_dragPoints && !graphDef.ReadOnly)
            {
                for (int i = 0; i < graphDef.SeriesRows.Count(); i++)
                {
                    Steema.TeeChart.Tools.DragPoint dragPoint1 = new Steema.TeeChart.Tools.DragPoint();
                    dragPoint1.Series = chart[i];
                    dragPoint1.Active = true;
                    dragPoint1.Style  = Steema.TeeChart.Tools.DragPointStyles.Y;

                    dragPoint1.Drag  += new Steema.TeeChart.Tools.DragPointEventHandler(this.dragPoint1_Drag);
                    dragPoint1.Cursor = System.Windows.Forms.Cursors.Hand;
                    chart.Tools.Add(dragPoint1);
                }
            }
        }
Ejemplo n.º 2
0
        void dragPoint1_Drag(Steema.TeeChart.Tools.DragPoint sender, int Index)
        {
            Console.WriteLine("dragPoint1_Drag");
            int seriesIndex = toolStripComboBoxDragPoints.SelectedIndex;

            if (seriesIndex > 0)
            {
                newvalue = tChart1[seriesIndex].YValues[Index];
                newvalue = System.Math.Round(newvalue, 3);
                tChart1[seriesIndex].YValues[Index] = newvalue;

                int colIndex = seriesIndex;
                //if (m_db == HydrometDataBase.Dayfiles)
                //    colIndex = seriesIndex * 2 - 1;

                prevRowIndex = Index;
                prevColIndex = colIndex;
                pointDrag    = true;
                // GraphDrawNeeded = true;
            }
            else
            {
                pointDrag    = false;
                newvalue     = -998877;
                prevColIndex = -1;
                prevRowIndex = -1;
            }
        }
Ejemplo n.º 3
0
        //  Steema.TeeChart.Tools.RectangleTool rectTool;

        public TimeSeriesTeeChartGraph()
        {
            InitializeComponent();
            seriesList            = new SeriesList();
            analysisType          = AnalysisType.TimeSeries;
            _missingDataValue     = Point.MissingValueFlag;
            dragPoint1            = new Steema.TeeChart.Tools.DragPoint();
            this.dragPoint1.Style = Steema.TeeChart.Tools.DragPointStyles.Y;
            this.tChart1.Tools.Add(this.dragPoint1);
            this.dragPoint1.Drag += new Steema.TeeChart.Tools.DragPointEventHandler(dragPoint1_Drag);
            //rectTool = new Steema.TeeChart.Tools.RectangleTool(tChart1.Chart);
        }
Ejemplo n.º 4
0
 private void OnDragInitWater(Steema.TeeChart.Tools.DragPoint sender, int index)
 {
     // -----------------------------------------------
     // User is dragging a initwater point - send out
     // an event so that our parent form can subscribe
     // to the event and update their table.
     // -----------------------------------------------
     //Steema.TeeChart.Tools.DragPoint dp = (Steema.TeeChart.Tools.DragPoint)sender;
     //double NewValue = InitialWaterLine.XValues[index];
     //if (OnWaterChange != null)
     //   OnWaterChange.Invoke(index, NewValue);
 }
Ejemplo n.º 5
0
        public TimeSeriesHydrographEditor(TimeInterval db)
        {
            InitializeComponent();

#if SpreadsheetGear
            var uc = new TimeSeriesSpreadsheetSG();
#else
            var uc = new TimeSeriesSpreadsheet();
#endif
            uc.Parent = this.panelGraphTable;
            uc.Dock   = DockStyle.Fill;
            uc.BringToFront();

            timeSeriesSpreadsheet1 = uc;

            m_db = db;
            //SetupTimeSelector(db);

            this.checkBoxShowPoints.Checked = UserPreference.Lookup("ShowPoints") == "True";


            annotation1 = new Steema.TeeChart.Tools.Annotation(tChart1.Chart);

            originalDataXmlFilename = Path.Combine(FileUtility.GetTempPath(), db.ToString() + DateTime.Now.Ticks + "_download.xml");

            checkBoxShowBadData.Visible = false;

            Logger.WriteLine(m_db.ToString(), "ui");
            if (m_db == TimeInterval.Daily)
            {
                BackColor = Color.Lavender;
            }


            dragPoint1            = new Steema.TeeChart.Tools.DragPoint();
            this.dragPoint1.Style = Steema.TeeChart.Tools.DragPointStyles.Y;
            this.tChart1.Tools.Add(this.dragPoint1);
            this.dragPoint1.Drag += new Steema.TeeChart.Tools.DragPointEventHandler(this.dragPoint1_Drag);


            tChart1.MouseMove += new MouseEventHandler(tChart1_MouseMove);
            var nearest = new Steema.TeeChart.Tools.NearestPoint(tChart1.Chart);

            LoadSiteList();
            this.comboBoxInputs.Text = UserPreference.Lookup("Inputs" + m_db.ToString());


            this.dragPoint1.Active = false;
            this.dragPoint1.Series = null;
            //    HydrometEdits.Progress += new ProgressEventHandler(HydrometEdits_Progress);

            timeSeriesSpreadsheet1.UpdateCompleted += new EventHandler <EventArgs>(timeSeriesSpreadsheet1_UpdateCompleted);
        }
Ejemplo n.º 6
0
        private void dragPoint1_Drag(Steema.TeeChart.Tools.DragPoint sender,
                                     int Index)
        {
            int seriesIndex = chart.Series.IndexOf(sender.Series);

            if (seriesIndex >= 0)
            {
                double val = chart[seriesIndex].YValues[Index];
                val = Math.Round(val, 2);
                chart[seriesIndex].YValues[Index] = val;

                DateTime t = Steema.TeeChart.Utils.DateTime(chart[seriesIndex].XValues[Index]);
                graphDef.UpdateIntervalTable(seriesIndex, t, val);
                dragDateTime          = t;
                dragSeriesIndex       = seriesIndex;
                m_SetActiveCellNeeded = true;
            }
        }
Ejemplo n.º 7
0
        public TimeSeriesTeeChartGraph()
        {
            InitializeComponent();
            seriesList            = new SeriesList();
            analysisType          = AnalysisType.TimeSeries;
            _missingDataValue     = Point.MissingValueFlag;
            dragPoint1            = new Steema.TeeChart.Tools.DragPoint();
            this.dragPoint1.Style = Steema.TeeChart.Tools.DragPointStyles.Y;
            this.tChart1.Tools.Add(this.dragPoint1);
            this.dragPoint1.Drag            += new Steema.TeeChart.Tools.DragPointEventHandler(dragPoint1_Drag);
            annotation1                      = new Steema.TeeChart.Tools.Annotation(tChart1.Chart);
            annotation1.Position             = Steema.TeeChart.Tools.AnnotationPositions.LeftTop;
            annotation1.Shape.Shadow.Visible = false;
            annotation1.Shape.Pen.Visible    = false;
            //annotation1. .forma.Callout = Steema.TeeChart.Tools.AnnotationCallout.
            annotation1.Active = true;

            this.toolStripComboBoxZoomType.SelectedIndex = 0;
        }
Ejemplo n.º 8
0
        private void dragPoint1_Drag(Steema.TeeChart.Tools.DragPoint sender, int Index)
        {
            int seriesIndex = 0;// comboBoxEditSeries.SelectedIndex;

            if (seriesIndex >= 0 && tChart1.Series.Count > 0)
            {
                newvalue = tChart1[seriesIndex].YValues[Index];
                newvalue = System.Math.Round(newvalue, 2);
                tChart1[seriesIndex].YValues[Index] = newvalue;

                prevRowIndex = Index;
                prevColIndex = seriesIndex + 1; // offset for date column
                // update spreasheet...
                GraphDrawNeeded = true;
            }
            else
            {
                prevColIndex = -1;
                prevRowIndex = -1;
            }
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Tool_DragPoint));
     this.checkBox1  = new System.Windows.Forms.CheckBox();
     this.comboBox1  = new System.Windows.Forms.ComboBox();
     this.label1     = new System.Windows.Forms.Label();
     this.button1    = new System.Windows.Forms.Button();
     this.dragPoint1 = new Steema.TeeChart.Tools.DragPoint();
     this.points1    = new Steema.TeeChart.Styles.Points();
     this.panel1.SuspendLayout();
     this.chartContainer.SuspendLayout();
     this.SuspendLayout();
     //
     // textBox1
     //
     this.textBox1.Size = new System.Drawing.Size(466, 48);
     this.textBox1.Text = "The Drag Point tool allows clicking and moving Series points at run-time, using t" +
                          "he mouse.\r\nClick and drag a point !";
     //
     // panel1
     //
     this.panel1.Controls.Add(this.button1);
     this.panel1.Controls.Add(this.label1);
     this.panel1.Controls.Add(this.comboBox1);
     this.panel1.Controls.Add(this.checkBox1);
     this.panel1.Location = new System.Drawing.Point(0, 48);
     this.panel1.Size     = new System.Drawing.Size(466, 41);
     //
     // tChart1
     //
     //
     //
     //
     this.tChart1.Aspect.ZOffset = 0;
     //
     //
     //
     //
     //
     //
     this.tChart1.Axes.Bottom.MaximumOffset = 5;
     this.tChart1.Axes.Bottom.MinimumOffset = 5;
     //
     //
     //
     this.tChart1.Axes.Left.MaximumOffset = 5;
     this.tChart1.Axes.Left.MinimumOffset = 5;
     //
     //
     //
     this.tChart1.Legend.Visible = false;
     this.tChart1.Series.Add(this.points1);
     this.tChart1.Size = new System.Drawing.Size(466, 197);
     this.tChart1.Tools.Add(this.dragPoint1);
     //
     // chartContainer
     //
     this.chartContainer.Location = new System.Drawing.Point(0, 89);
     this.chartContainer.Size     = new System.Drawing.Size(466, 197);
     //
     // checkBox1
     //
     this.checkBox1.Checked         = true;
     this.checkBox1.CheckState      = System.Windows.Forms.CheckState.Checked;
     this.checkBox1.FlatStyle       = System.Windows.Forms.FlatStyle.Flat;
     this.checkBox1.Location        = new System.Drawing.Point(13, 7);
     this.checkBox1.Name            = "checkBox1";
     this.checkBox1.Size            = new System.Drawing.Size(54, 21);
     this.checkBox1.TabIndex        = 0;
     this.checkBox1.Text            = "&Active";
     this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
     //
     // comboBox1
     //
     this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     this.comboBox1.Items.AddRange(new object[] {
         "X only",
         "Y only",
         "X and Y"
     });
     this.comboBox1.Location              = new System.Drawing.Point(130, 7);
     this.comboBox1.Name                  = "comboBox1";
     this.comboBox1.Size                  = new System.Drawing.Size(100, 21);
     this.comboBox1.TabIndex              = 1;
     this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
     //
     // label1
     //
     this.label1.AutoSize  = true;
     this.label1.Location  = new System.Drawing.Point(96, 9);
     this.label1.Name      = "label1";
     this.label1.Size      = new System.Drawing.Size(33, 13);
     this.label1.TabIndex  = 2;
     this.label1.Text      = "&Style:";
     this.label1.TextAlign = System.Drawing.ContentAlignment.TopRight;
     //
     // button1
     //
     this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.button1.Location  = new System.Drawing.Point(273, 6);
     this.button1.Name      = "button1";
     this.button1.Size      = new System.Drawing.Size(75, 23);
     this.button1.TabIndex  = 3;
     this.button1.Text      = "&Edit...";
     this.button1.Click    += new System.EventHandler(this.button1_Click);
     //
     // dragPoint1
     //
     this.dragPoint1.Cursor = System.Windows.Forms.Cursors.Hand;
     this.dragPoint1.Series = this.points1;
     //
     // points1
     //
     this.points1.Color     = System.Drawing.Color.FromArgb(((int)(((byte)(68)))), ((int)(((byte)(102)))), ((int)(((byte)(163)))));
     this.points1.ColorEach = false;
     //
     //
     //
     this.points1.LinePen.Color = System.Drawing.Color.FromArgb(((int)(((byte)(41)))), ((int)(((byte)(61)))), ((int)(((byte)(98)))));
     //
     //
     //
     //
     //
     //
     this.points1.Marks.Callout.ArrowHead     = Steema.TeeChart.Styles.ArrowHeadStyles.None;
     this.points1.Marks.Callout.ArrowHeadSize = 8;
     //
     //
     //
     this.points1.Marks.Callout.Brush.Color = System.Drawing.Color.Black;
     this.points1.Marks.Callout.Distance    = 0;
     this.points1.Marks.Callout.Draw3D      = false;
     this.points1.Marks.Callout.Length      = 0;
     this.points1.Marks.Callout.Style       = Steema.TeeChart.Styles.PointerStyles.Rectangle;
     this.points1.Marks.Callout.Visible     = false;
     //
     //
     //
     //
     //
     //
     this.points1.Pointer.Brush.Color = System.Drawing.Color.FromArgb(((int)(((byte)(68)))), ((int)(((byte)(102)))), ((int)(((byte)(163)))));
     //
     //
     //
     this.points1.Pointer.Brush.Gradient.StartColor = System.Drawing.Color.FromArgb(((int)(((byte)(68)))), ((int)(((byte)(102)))), ((int)(((byte)(163)))));
     //
     //
     //
     this.points1.Pointer.Pen.Color = System.Drawing.Color.FromArgb(((int)(((byte)(41)))), ((int)(((byte)(61)))), ((int)(((byte)(98)))));
     this.points1.Pointer.Style     = Steema.TeeChart.Styles.PointerStyles.Rectangle;
     this.points1.Title             = "points1";
     //
     //
     //
     this.points1.XValues.DataMember = "X";
     this.points1.XValues.Order      = Steema.TeeChart.Styles.ValueListOrder.Ascending;
     //
     //
     //
     this.points1.YValues.DataMember = "Y";
     //
     // Tool_DragPoint
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(466, 286);
     this.Name  = "Tool_DragPoint";
     this.Load += new System.EventHandler(this.Tools_DragPoint_Load);
     this.panel1.ResumeLayout(false);
     this.panel1.PerformLayout();
     this.chartContainer.ResumeLayout(false);
     this.ResumeLayout(false);
     this.PerformLayout();
 }