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


C# GraphPane.AddY2Axis方法代码示例

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


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

示例1: Form1_Load


//.........这里部分代码省略.........
            PointPairList list2 = new PointPairList();

            for ( int i=0; i<100; i++ )
            {
                double x = (double) i;
                double y = Math.Sin( i / 8.0 ) * 100000 + 150000;
                double y2 = Math.Sin( i / 3.0 ) * 300 - 400;
                list.Add( x, y );
                list2.Add( x, y2 );
                //double z = Math.Abs( Math.Cos( i / 8.0 ) ) * y;
            }

            LineItem myCurve = myPane.AddCurve( "curve", list, Color.Blue, SymbolType.Diamond );
            LineItem myCurve2 = myPane.AddCurve( "curve2", list2, Color.Red, SymbolType.Diamond );
            myCurve2.IsY2Axis = true;

            myPane.Y2Axis.IsVisible = true;

            AlignYZeroLines( myPane, 12 );
            myPane.YAxis.IsMinorOppositeTic = false;
            myPane.Y2Axis.IsMinorOppositeTic = false;

            trackBar1.Minimum = 0;
            trackBar1.Maximum = 100;
            trackBar1.Value = 50;

            #endif

            #if false	// Basic curve test - Multi-Y axes

            myPane = new GraphPane( new RectangleF( 0, 0, 640, 480 ), "Title", "XAxis", "YAxis" );

            myPane.AddYAxis( "Another Y Axis" );
            myPane.AddY2Axis( "Another Y2 Axis" );
            myPane.Y2Axis.Title.Text = "My Y2 Axis";
            myPane.Y2AxisList[0].IsVisible = true;
            myPane.Y2AxisList[1].IsVisible = true;

            PointPairList list = new PointPairList();

            for ( int i=0; i<100; i++ )
            {
                //double x = (double) i;
                double x = new XDate( 2001, 1, i*3 );
                double y = Math.Sin( i / 8.0 ) * 100000 + 100001;
                list.Add( x, y );
                double z = Math.Abs( Math.Cos( i / 8.0 ) ) * y;
            }

            LineItem myCurve = myPane.AddCurve( "curve", list, Color.Blue, SymbolType.Diamond );

            myCurve.YAxisIndex = 1;

            myPane.XAxis.IsSkipLastLabel = false;
            myPane.XAxis.Type = AxisType.DateAsOrdinal;
            myPane.AxisChange( this.CreateGraphics() );

            trackBar1.Minimum = 0;
            trackBar1.Maximum = 100;
            trackBar1.Value = 50;

            #endif

            #if false	// Basic curve test - Date Axis w/ Time Span

            myPane = new GraphPane( new RectangleF( 0, 0, 640, 480 ), "Title", "XAxis", "YAxis" );
开发者ID:Jungwon,项目名称:ZedGraph,代码行数:67,代码来源:Form1.cs


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