⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmgraph.cs

📁 车载GPS?今天这个就是最好的工具
💻 CS
📖 第 1 页 / 共 5 页
字号:

                // Separate Axes //
                Pego1.PeGrid.Option.MultiAxisStyle = MultiAxisStyle.SeparateAxes;

                // Axis Sizing //
                Pego1.PeUserInterface.Allow.MultiAxesSizing = true;

                // Legend Inside Each Axis //
                Pego1.PeLegend.Style = LegendStyle.OneLineInsideAxis;

                // Get rid of 3d stuff //
                Pego1.PePlot.DataShadows = DataShadows.None;

                // Other various properties //
                Pego1.PeColor.BitmapGradientMode = true;
                Pego1.PeColor.QuickStyle = QuickStyle.LightInset;
                Pego1.PePlot.MarkDataPoints = true;
            }
            else if(m_nChart == 14)
            {
                //*********************************************************************'
                //*********************************************************************'
                //014  Graph showing use of PEgethotspot

                //! Move mouse over subset legends, point labels, or data points
                //! and watch title bar.

                // This example builds upon the basic CreateSimpleGraph '000' example chart //
                CreateSimpleGraph();

                // Enable some various hot spots //
                Pego1.PeUserInterface.HotSpot.Data = true;
                Pego1.PeUserInterface.HotSpot.Subset = true;
                Pego1.PeUserInterface.HotSpot.Point = true;
                Pego1.PeUserInterface.HotSpot.Size = HotSpotSize.Large;

                /*///////////////////////////////////////////////
                // Code below is found in the MouseMove event //
                ////////////////////////////////////////////////
                Int32 extra1;  
                Int32 extra2;  
                Int32 pX;  
                Int32 pY;  
                System.Drawing.Point pt;  
                Gigasoft.ProEssentials.Structs.HotSpotData ds;  

                // get last mouse location within control //'
                pt = Pego1.PeUserInterface.Cursor.LastMouseMove;
                pX = pt.X;
                pY = pt.Y;

                // Calls to fill hot spot data structure with hot spot data at given x and y
                Pego1.PeFunction.GetHotSpot(pX, pY);

                // Calls PEgethotspot //'
                ds = Pego1.PeFunction.GetHotSpotData();				
                extra1 = ds.Data1;
                extra2 = ds.Data2;

                if(ds.Type == HotSpotType.DataPoint) 
                    this.Text = "DataPoint value " + Pego1.PeData.Y[extra1, extra2].ToString();
                else if(ds.Type == HotSpotType.Subset)
                    this.Text = "Subset Legend is " + Pego1.PeString.SubsetLabels[extra1];
                else if(ds.Type == HotSpotType.Point) 
                    this.Text = "Point Label is " + Pego1.PeString.PointLabels[extra1];
                else
                    this.Text = "No Hot Spot";
                */
            }
            else if(m_nChart == 15)
            {
                //*********************************************************************'
                //*********************************************************************'
                //015  Graph showing use of GraphAnnotations

                // This example builds upon the basic CreateSimpleGraph '000' example chart //
                CreateSimpleGraph();

                // simplify chart by reducing subsets //
                Pego1.PeData.Subsets = 1;
                Pego1.PePlot.Method = GraphPlottingMethod.PointsPlusLine;

                // Add some various graph annotations //
                Pego1.PeAnnotation.Show = true;
                Pego1.PeFont.GraphAnnotationTextSize = 100;

                // Uncomment this line to place annotations in background //
                // Pego1.AnnotationsInFront = false

                // Give user ability to show or hide annotations //
                Pego1.PeUserInterface.Menu.AnnotationControl = true;

                // Place a symbol //
                Pego1.PeAnnotation.Graph.X[0] = 0.5;
                Pego1.PeAnnotation.Graph.Y[0] = 320;
                Pego1.PeAnnotation.Graph.Type[0] = 14; //GraphAnnotationType.SmallCross;
                Pego1.PeAnnotation.Graph.Color[0] = Color.FromArgb(198, 0, 0);
                Pego1.PeAnnotation.Graph.Text[0] = "Cross";

                // Draw some lines //'
                Pego1.PeAnnotation.Graph.X[1] = 1.5;
                Pego1.PeAnnotation.Graph.Y[1] = 320;
                Pego1.PeAnnotation.Graph.Type[1] = 38; //GraphAnnotationType.ThinSolidLine;
                Pego1.PeAnnotation.Graph.Color[1] = Color.FromArgb(0, 198, 198);
                Pego1.PeAnnotation.Graph.Text[1] = "Start";

                Pego1.PeAnnotation.Graph.X[2] = 2.5;
                Pego1.PeAnnotation.Graph.Y[2] = 420;
                Pego1.PeAnnotation.Graph.Type[2] = 45; //GraphAnnotationType.LineContinue;
                Pego1.PeAnnotation.Graph.Color[2] = Color.Black;
                Pego1.PeAnnotation.Graph.Text[2] = "";

                Pego1.PeAnnotation.Graph.X[3] = 3.5;
                Pego1.PeAnnotation.Graph.Y[3] = 320;
                Pego1.PeAnnotation.Graph.Type[3] = 45; //GraphAnnotationType.LineContinue;
                Pego1.PeAnnotation.Graph.Color[3] = Color.FromArgb(0, 0, 198);
                Pego1.PeAnnotation.Graph.Text[3] = "End";

                // Place a rectangle //'
                Pego1.PeAnnotation.Graph.X[4] = 4.5;
                Pego1.PeAnnotation.Graph.Y[4] = 420;
                Pego1.PeAnnotation.Graph.Type[4] = 46; //GraphAnnotationType.TopLeft;
                Pego1.PeAnnotation.Graph.Color[4] = Color.Black;
                Pego1.PeAnnotation.Graph.Text[4] = "";

                Pego1.PeAnnotation.Graph.X[5] = 5.5;
                Pego1.PeAnnotation.Graph.Y[5] = 320;
                Pego1.PeAnnotation.Graph.Type[5] = 47; //GraphAnnotationType.BottomRight;
                Pego1.PeAnnotation.Graph.Color[5] = Color.Black;
                Pego1.PeAnnotation.Graph.Text[5] = "";

                Pego1.PeAnnotation.Graph.X[6] = 5.5;
                Pego1.PeAnnotation.Graph.Y[6] = 320;
                Pego1.PeAnnotation.Graph.Type[6] = 71; //GraphAnnotationType.EllipseFill;
                Pego1.PeAnnotation.Graph.Color[6] = Color.FromArgb(234, 123, 53);
                Pego1.PeAnnotation.Graph.Text[6] = "";

                // Place a polygon //'
                Pego1.PeAnnotation.Graph.X[7] = 6.5;
                Pego1.PeAnnotation.Graph.Y[7] = 420;
                Pego1.PeAnnotation.Graph.Type[7] = 74; //GraphAnnotationType.StartPoly;
                Pego1.PeAnnotation.Graph.Color[7] = Color.Black;
                Pego1.PeAnnotation.Graph.Text[7] = "";

                Pego1.PeAnnotation.Graph.X[8] = 7.5;
                Pego1.PeAnnotation.Graph.Y[8] = 420;
                Pego1.PeAnnotation.Graph.Type[8] = 75; //GraphAnnotationType.AddPolyPoint;
                Pego1.PeAnnotation.Graph.Color[8] = Color.Black;
                Pego1.PeAnnotation.Graph.Text[8] = "";

                Pego1.PeAnnotation.Graph.X[9] = 7.5;
                Pego1.PeAnnotation.Graph.Y[9] = 320;
                Pego1.PeAnnotation.Graph.Type[9] = 76; //GraphAnnotationType.EndPolygon;
                Pego1.PeAnnotation.Graph.Color[9] = Color.FromArgb(134, 223, 53);
                Pego1.PeAnnotation.Graph.Text[9] = "";

                // Place a paragraph of text //'
                Pego1.PeAnnotation.Graph.X[10] = 0;
                Pego1.PeAnnotation.Graph.Y[10] = 0;
                Pego1.PeAnnotation.Graph.Type[10] = 84; //GraphAnnotationType.StartText;
                Pego1.PeAnnotation.Graph.Color[10] = Color.Black;
                Pego1.PeAnnotation.Graph.Text[10] = "This is a line of text." + '\n';

                Pego1.PeAnnotation.Graph.X[11] = 0;
                Pego1.PeAnnotation.Graph.Y[11] = 0;
                Pego1.PeAnnotation.Graph.Type[11] = 85; //GraphAnnotationType.AddText;
                Pego1.PeAnnotation.Graph.Color[11] = Color.Black;
                Pego1.PeAnnotation.Graph.Text[11] = "Another line of text." + '\n';

                Pego1.PeAnnotation.Graph.X[12] = 0;
                Pego1.PeAnnotation.Graph.Y[12] = 0;
                Pego1.PeAnnotation.Graph.Type[12] = 85; //GraphAnnotationType.AddText;
                Pego1.PeAnnotation.Graph.Color[12] = Color.Black;
                Pego1.PeAnnotation.Graph.Text[12] = "Yet another line of text." + '\n';

                Pego1.PeAnnotation.Graph.X[13] = 7.75;
                Pego1.PeAnnotation.Graph.Y[13] = 420;
                Pego1.PeAnnotation.Graph.Type[13] = 86; //GraphAnnotationType.Paragraph;
                Pego1.PeAnnotation.Graph.Color[13] = Color.FromArgb(198, 198, 0);
                Pego1.PeAnnotation.Graph.Text[13] = "";

                // Other various properties //
                Pego1.PeColor.BitmapGradientMode = true;
                Pego1.PeColor.QuickStyle = QuickStyle.DarkLine;
            }
            else if(m_nChart == 16)
            {
                //*********************************************************************'
                //*********************************************************************'
                //016  Graph showing date time handling

                //! This examples shows Date/Time handling vith the Graph Object.
                //! The Graph is suited to show discontinuous date/time scales.
                //! Discontinuous for example, 8am to 5pm, Monday to Friday.

                //! Here's a tip, when debugging your data-passing logic, use the
                //! built-in text export feature to verify that data is as
                //! expected.

                Pego1.PeData.Subsets = 1;
                Pego1.PeData.Points = 6000;

                // Set Date Time Handling related properties //
                Pego1.PeData.DeltaX = 5;         // 5 minutes between data points
                Pego1.PeData.DeltasPerDay = 96;  // 96 data points in one day
                Pego1.PeData.StartTime = 0.3333333333334; // 8 am
                Pego1.PeData.UsingXDataii = true;

                double d;
                Int32 i = 0;
                Int32 p;				

                d = DateTime.Now.ToOADate();				
                d = System.Convert.ToInt32(d);

                for(p = 0; p <= 5999; p++)
                {
                    Pego1.PeData.Y[0, p] = (float)(5 + ((Rand_Num.NextDouble()) * 55) + (System.Math.Sin(p * 0.003) * 500));

                    //! The toughest thing about DateTimeMode within Graph Object is
                    //! to make sure your XData is constructed so that every XData is
                    //! DeltaX apart and there are DeltasPerDay worth of data points
                    //! in each day. Well, at least for intraday data.  Daily/Weekly/Monthly
                    //! data is much easier to work with.

                    //! Also note that if you do not set XData, ProEssentials will
                    //! automatically construct your XData with respect to the
                    //! AutoXData, DeltaX, StartTime, and DeltasPerDay properties.

                    // Construct XDataII to match parameters above //

                    Pego1.PeData.Xii[0, p] = d + 0.333333333333333 + (((i * 5.0) / 60.0) / 24.0);
                    // every 5 minutes, 60 minutes in an hour, 24 hours in a day

                    i = i + 1;
                    if(i >= 96)
                    {
                        i = 0;
                        d = d + 1;
                    }
                }

                // You can modify date label formats with //
                Pego1.PeGrid.Option.YearMonthDayPrompt = YearMonthDayPrompt.InsideTop;

                // Optional related properties ...
                // PeGrid.Option.TimeLabelType
                // PeGrid.Option.DayLabelType
                // PeGrid.Option.MonthLabelType
                // PeGrid.Option.YearLabelType

                // Enable DateTimeMode //
                Pego1.PeData.DateTimeMode = true;

                // Enable Zooming, zoom the chart and see how structure //
                // of x axis changes as you zoom //
                Pego1.PeUserInterface.Allow.Zooming = AllowZooming.Horizontal;

                // Set various properties //
                Pego1.PeConfigure.PrepareImages = true;
                Pego1.PeColor.SubsetColors[0] = Color.Black;
                Pego1.PePlot.DataShadows = DataShadows.None;
                Pego1.PeGrid.LineControl = GridLineControl.None;
                Pego1.PeUserInterface.Allow.FocalRect = false;
                Pego1.PeFont.Fixed = true;
                Pego1.PeUserInterface.Allow.ZoomStyle = ZoomStyle.Ro2Not;

                Pego1.PeColor.BitmapGradientMode = true;
                Pego1.PeColor.QuickStyle = QuickStyle.LightShadow;

                Pego1.PePlot.Option.GradientBars = 8;
                Pego1.PePlot.Option.LineShadows = true;
                Pego1.PeFont.MainTitle.Bold = true;
                Pego1.PeFont.SubTitle.Bold = true;
                Pego1.PeFont.Label.Bold = true;
                Pego1.PeConfigure.TextShadows = TextShadows.BoldText;
                Pego1.PeFont.FontSize = FontSize.Large;
                Pego1.PeUserInterface.Scrollbar.ScrollingScaleControl = true;

            }
            else if(m_nChart == 17)
            {
                //*********************************************************************'
                //*********************************************************************'
                //017  Graph showing real-time data handling

                // No Flicker //
                Pego1.PeConfigure.PrepareImages = true;
                Pego1.PeConfigure.CacheBmp = true;

                // Set Subsets and Points //
                Pego1.PeData.Subsets = 2;      // set number of subsets
                Pego1.PeData.Points = 200;     // number of data points

                Pego1.PeUserInterface.Scrollbar.PointsToGraph = 20;
                Pego1.PeUserInterface.Scrollbar.PointsToGraphInit = PointsToGraphInit.Last;
                Pego1.PePlot.Method = GraphPlottingMethod.PointsPlusLine;

                // Main Title
                Pego1.PeString.MainTitle = "Graph Real Time Example";
  

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -