当前位置: 首页>>代码示例>>C#>>正文


C# GraphPane.AddErrorBar方法代码示例

本文整理汇总了C#中ZedGraph.GraphPane.AddErrorBar方法的典型用法代码示例。如果您正苦于以下问题:C# GraphPane.AddErrorBar方法的具体用法?C# GraphPane.AddErrorBar怎么用?C# GraphPane.AddErrorBar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ZedGraph.GraphPane的用法示例。


在下文中一共展示了GraphPane.AddErrorBar方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GenerateRangeGraphAndTable

        private void GenerateRangeGraphAndTable()
        {
            #region Write graph
            GraphPane graphPane = new GraphPane(new Rectangle(0, 0, 420, 280), "", "", "");

            graphPane.CurveList.Clear();
            graphPane.XAxis.Title = "Test Series";
            graphPane.YAxis.Title = "Response time in milliseconds";

            PointPairList list1 = new PointPairList();
            PointPairList hList = new PointPairList();

            int count = 0;
            foreach (TestDataElement d in testDataList)
            {
                count++;
                list1.Add(count, d.avgResponseTime);
                hList.Add(count, d.maxResponseTime, d.minResponseTime);
            }

            ErrorBarItem rangebar = graphPane.AddErrorBar("Range", hList, Color.Blue);
            rangebar.ErrorBar.PenWidth = 3;
            rangebar.ErrorBar.Symbol.IsVisible = false;

            LineItem curve = graphPane.AddCurve("Average", list1, Color.Red, SymbolType.Default);
            curve.Line.IsVisible = true;
            curve.Line.IsSmooth = false;
            curve.Symbol.Size = 4;
            curve.Symbol.Fill = new Fill(Color.Red);
            curve.Line.Fill = new Fill(Color.White, Color.LightSkyBlue, -45F);

            graphPane.XAxis.IsShowGrid = true;
            graphPane.YAxis.IsShowGrid = true;
            graphPane.XAxis.Max = testDataList.Count+1;

            SaveGraphImage(graphPane, reportPath + @"\range.png");
            #endregion

            #region Write table
            // write table header
            rangeTable = new StringBuilder();
            rangeTable.Append("<table><thead><tr>\n");
            rangeTable.Append("<th width=\"25%\">Thread</th>\n");
            rangeTable.Append("<th width=\"25%\">Mean response</th>\n");
            rangeTable.Append("<th width=\"25%\">Min response</th>\n");
            rangeTable.Append("<th width=\"25%\">Max response</th>\n");
            rangeTable.Append("</tr></thead><tbody>\n");
            count = 0;
            bool oddline = true;
            foreach (TestDataElement d in testDataList)
            {
                count++;
                if (oddline == true)
                    rangeTable.Append("<tr class=\"odd\">\n");
                else
                    rangeTable.Append("<tr class=\"even\">\n");

                rangeTable.Append("<td class=\"s\">");
                rangeTable.AppendFormat("{0}", count);
                rangeTable.Append("</td>\n");

                rangeTable.Append("<td class=\"s\">");
                rangeTable.AppendFormat("{0:f2}", d.avgResponseTime);
                rangeTable.Append("</td>\n");

                rangeTable.Append("<td class=\"s\">");
                rangeTable.AppendFormat("{0:f2}", d.minResponseTime);
                rangeTable.Append("</td>\n");

                rangeTable.Append("<td class=\"s\">");
                rangeTable.AppendFormat("{0:f2}", d.maxResponseTime);
                rangeTable.Append("</td>\n");
                oddline = !oddline;
            }
            rangeTable.Append("</tr></table>\n");
            #endregion
        }
开发者ID:cjus,项目名称:mcww,代码行数:77,代码来源:ReportGenerator.cs

示例2: ErrorBarChart

        public void ErrorBarChart()
        {
            //	Create a new	graph
            testee = new GraphPane( new Rectangle( 40, 40, form2.Size.Width - 80, form2.Size.Height - 80 ),
                "ErrorBar Chart Test ", "X AXIS", "Y Value" );

            double[] hi = new double[20];
            double[] low = new double[20];
            double[] x = new double[20];

            for ( int i = 45; i < 65; i++ )
            {
                x[i - 45] = (double)new XDate( 2004, 12, i - 30, 0, 0, 0 );
                if ( i % 2 == 1 )
                    hi[i - 45] = (double)i * 1.03;
                else
                    hi[i - 45] = (double)i * .99;

                low[i - 45] = .97 * hi[i - 45];
            }

            ErrorBarItem myCurve = testee.AddErrorBar( "My	Curve", x, hi, low, Color.Blue );

            testee.XAxis.Scale.FontSpec.Size = 12;
            testee.XAxis.Scale.FontSpec.Angle = 90;

            //	Set the XAxis	to date type
            testee.XAxis.Type = AxisType.Date;
            testee.XAxis.Scale.Min = x[0] - 1;
            myCurve.Bar.PenWidth = 2;

            testee.YAxis.MajorGrid.IsVisible = true;
            testee.YAxis.MinorGrid.IsVisible = true;

            form2.WindowState = FormWindowState.Maximized;
            testee.AxisChange( form2.CreateGraphics() );

            TestUtils.DelaySeconds( 3000 );
            Assert.IsTrue( TestUtils.promptIfTestWorked( "Was the typical Error Bar chart with a date X-Axis displayed?" ) );
        }
开发者ID:Jungwon,项目名称:ZedGraph,代码行数:40,代码来源:ZGTest.cs

示例3: initializeGraphControl

        private void initializeGraphControl (ZedGraphControl zedGraphControl)
        {
            zedGraphControl.MasterPane.PaneList.Clear();
            zedGraphControl.MasterPane.SetLayout(zedGraphControl.CreateGraphics(), 1, (int) IonSeries.Count + 1);
            zedGraphControl.MasterPane.InnerPaneGap = 0;
            zedGraphControl.MasterPane.Border.IsVisible = true;
            zedGraphControl.IsEnableHPan = false;
            zedGraphControl.IsEnableHZoom = false;
            zedGraphControl.IsSynchronizeYAxes = true;
            zedGraphControl.IsZoomOnMouseCenter = true;

            var axisPane = new GraphPane();
            axisPane.Legend.IsVisible = false;
            axisPane.IsFontsScaled = false;
            axisPane.XAxis.IsVisible = false;
            axisPane.YAxis.Scale.Min = 0;
            axisPane.YAxis.Scale.Max = 100;
            axisPane.YAxis.Title.Text = zedGraphControl.Text;
            axisPane.YAxis.Title.Gap = 0.05f;
            axisPane.YAxis.MajorTic.IsOpposite = false;
            axisPane.YAxis.MinorTic.IsOpposite = false;
            axisPane.Chart.Border.IsVisible = false;
            axisPane.Border.IsVisible = false;
            axisPane.Margin.Left = 1;
            axisPane.Margin.Right = 0;
            axisPane.Title.Text = "Series:";
            zedGraphControl.MasterPane.Add(axisPane);

            var csr = new ColorSymbolRotator();
            for (int i = 0; i < (int) IonSeries.Count; ++i)
            {
                var graphPane = new GraphPane();
                graphPane.Title.Text = IonSeriesLabels[i];
                graphPane.Legend.IsVisible = false;
                graphPane.IsFontsScaled = false;
                graphPane.Chart.Border.IsVisible = false;
                graphPane.Border.IsVisible = false;
                graphPane.XAxis.Scale.Min = -1;
                graphPane.XAxis.Scale.Max = 1;
                graphPane.XAxis.IsVisible = false;
                graphPane.YAxis.Scale.Min = 0;
                graphPane.YAxis.Scale.Max = 100;
                graphPane.YAxis.IsVisible = false;
                zedGraphControl.MasterPane.Add(graphPane);

                graphPane.BarSettings.Type = BarType.Overlay;
                graphPane.BarSettings.ClusterScaleWidth = 1;

                var mean = graphPane.AddCurve(IonSeriesLabels[i],
                                              new PointPairList(),
                                              Color.Black,
                                              SymbolType.Circle);
                mean.Line.IsVisible = false;
                mean.Symbol.Border.IsVisible = false;
                mean.Symbol.Fill.Type = FillType.Solid;

                var errorBar = graphPane.AddErrorBar(IonSeriesLabels[i],
                                                     new PointPairList(),
                                                     Color.Black);
                errorBar.Bar.IsVisible = true;
                errorBar.Bar.PenWidth = .1f;
                errorBar.Bar.Symbol.IsVisible = true;
                errorBar.Bar.Symbol.Type = SymbolType.HDash;
                errorBar.Bar.Symbol.Border.Width = .1f;
                errorBar.Bar.Symbol.Size = 4;

                var hiLowBar = graphPane.AddHiLowBar(IonSeriesLabels[i],
                                                     new PointPairList(),
                                                     Color.Black);
                hiLowBar.Bar.Fill.Type = FillType.None;

                var scatter = graphPane.AddCurve(IonSeriesLabels[i],
                                                 new PointPairList(),
                                                 csr.NextColor,
                                                 SymbolType.Circle);
                scatter.Line.IsVisible = false;
                scatter.Symbol.IsAntiAlias = true;
                scatter.Symbol.Border.IsVisible = false;
                scatter.Symbol.Fill.Type = FillType.Solid;
                scatter.Symbol.Size = 3f;
            }

            zedGraphControl.MasterPane.AxisChange();
            zedGraphControl.Refresh();
        }
开发者ID:lgatto,项目名称:proteowizard,代码行数:85,代码来源:FragmentationStatisticsForm.cs


注:本文中的ZedGraph.GraphPane.AddErrorBar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。