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


C# XDate.AddMinutes方法代码示例

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


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

示例1: hScrollBar1_ValueChanged

        private void hScrollBar1_ValueChanged(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            XDate startx = new XDate(_firstDate.Year, _firstDate.Month, _firstDate.Day, _firstDate.Hour, _firstDate.Minute, _firstDate.Second);
            
            XDate endx = new XDate(startx);
            startx.AddMinutes(hScrollBar1.Value*_minutesPage);
            endx.AddMinutes((hScrollBar1.Value + 1)*_minutesPage);
            for (int i = 0; i < zedGraphControl1.MasterPane.PaneList.Count; i++)
            {
                zedGraphControl1.MasterPane[i].XAxis.Scale.Min = (double)startx;
                zedGraphControl1.MasterPane[i].XAxis.Scale.Max = (double)endx;
            }
            int pixelunits = (int)Math.Ceiling((double)(hScrollBar1.Width - 130) / hScrollBar1.Maximum);
            lbScrollTime.Location = new Point(hScrollBar1.Left + pixelunits* hScrollBar1.Value,lbScrollTime.Location.Y);
            lbScrollTime.Text = String.Format("{0}-{1}", startx.DateTime.ToShortTimeString(), endx.DateTime.ToShortTimeString());

            if (_isAdaptingPointSize) SetPointSize();

            zedGraphControl1.AxisChange();
            zedGraphControl1.Refresh();
            
            this.Cursor = Cursors.Default;
            
        }
开发者ID:intille,项目名称:mitessoftware,代码行数:25,代码来源:Form1.cs

示例2: CreateGraph_JapaneseCandleStick

        // Japanese Candlestick
        private void CreateGraph_JapaneseCandleStick( ZedGraphControl z1 )
        {
            GraphPane myPane = z1.GraphPane;

            myPane.Title.Text = "Japanese Candlestick Chart Demo";
            myPane.XAxis.Title.Text = "Trading Date";
            myPane.YAxis.Title.Text = "Share Price, $US";

            StockPointList spl = new StockPointList();
            Random rand = new Random();

            // First day is jan 1st
            XDate xDate = new XDate( 2006, 1, 1 );
            double open = 50.0;

            for ( int i = 0; i < 500; i++ )
            {
                double x = xDate.XLDate;
                double close = open + rand.NextDouble() * 10.0 - 5.0;
                double hi = Math.Max( open, close ) + rand.NextDouble() * 5.0;
                double low = Math.Min( open, close ) - rand.NextDouble() * 5.0;

                StockPt pt = new StockPt( x, hi, low, open, close, 100000 );
                spl.Add( pt );

                open = close;
                // Advance one day
                xDate.AddMinutes( 1.0 );
                // but skip the weekends
                if ( XDate.XLDateToDayOfWeek( xDate.XLDate ) == 6 )
                    xDate.AddMinutes( 2.0 );
            }

            JapaneseCandleStickItem myCurve = myPane.AddJapaneseCandleStick( "trades", spl );
            myCurve.Stick.IsAutoSize = true;
            myCurve.Stick.Color = Color.Blue;

            // Use DateAsOrdinal to skip weekend gaps
            //myPane.XAxis.Type = AxisType.DateAsOrdinal;
            myPane.XAxis.Type = AxisType.Date;
            //myPane.XAxis.Scale.Min = new XDate( 2006, 1, 1 );

            // pretty it up a little
            myPane.Chart.Fill = new Fill( Color.White, Color.LightGoldenrodYellow, 45.0f );
            myPane.Fill = new Fill( Color.White, Color.FromArgb( 220, 220, 255 ), 45.0f );

            // Tell ZedGraph to calculate the axis ranges
            z1.AxisChange();
            z1.Invalidate();

            //z1.PointValueEvent += new ZedGraphControl.PointValueHandler( z1_PointValueEvent );
        }
开发者ID:Jungwon,项目名称:ZedGraph,代码行数:53,代码来源:Form1.cs

示例3: CalcMinorTicValue

		/// <summary>
		/// Determine the value for any minor tic.
		/// </summary>
		/// <remarks>
		/// This method properly accounts for <see cref="Scale.IsLog"/>, <see cref="Scale.IsText"/>,
		/// and other axis format settings.
		/// </remarks>
		/// <param name="baseVal">
		/// The value of the first major tic (floating point double).  This tic value is the base
		/// reference for all tics (including minor ones).
		/// </param>
		/// <param name="iTic">
		/// The major tic number (0 = first major tic).  For log scales, this is the actual power of 10.
		/// </param>
		/// <returns>
		/// The specified minor tic value (floating point double).
		/// </returns>
		internal override double CalcMinorTicValue(double baseVal, int iTic)
		{
			XDate xDate = new XDate(baseVal);

			switch (_minorUnit) {
				case DateUnit.Year:
				default:
					xDate.AddYears((double) iTic*_minorStep);
					break;
				case DateUnit.Month:
					xDate.AddMonths((double) iTic*_minorStep);
					break;
				case DateUnit.Day:
					xDate.AddDays((double) iTic*_minorStep);
					break;
				case DateUnit.Hour:
					xDate.AddHours((double) iTic*_minorStep);
					break;
				case DateUnit.Minute:
					xDate.AddMinutes((double) iTic*_minorStep);
					break;
				case DateUnit.Second:
					xDate.AddSeconds((double) iTic*_minorStep);
					break;
			}

			return xDate.XLDate;
		}
开发者ID:stewmc,项目名称:vixen,代码行数:45,代码来源:DateScale.cs

示例4: CreateStockPointList

        private static StockPointList CreateStockPointList(long valueStepSizeMinutes)
        {
            StockPointList spl = new StockPointList();
            Random rand = new Random();

            XDate xDate = new XDate(2013, 1, 1);
            double open = 50.0;

            for (int i = 0; i < 50; i++)
            {
                double x = xDate.XLDate;
                double close = open + rand.NextDouble() * 10.0 - 5.0;
                double hi = Math.Max(open, close) + rand.NextDouble() * 5.0;
                double low = Math.Min(open, close) - rand.NextDouble() * 5.0;

                StockPt pt = new StockPt(x, hi, low, open, close, 100000);
                spl.Add(pt);

                open = close;
                xDate.AddMinutes(valueStepSizeMinutes);

                if (XDate.XLDateToDayOfWeek(xDate.XLDate) == 6)
                {
                    xDate.AddDays(2.0);
                }
            }

            return spl;
        }
开发者ID:Jungwon,项目名称:ZedGraph,代码行数:29,代码来源:OHLCBarItemTests.cs

示例5: CalcMinorTicValue

        /// <summary>
        /// Determine the value for any minor tic.
        /// </summary>
        /// <remarks>
        /// This method properly accounts for <see cref="IsLog"/>, <see cref="IsText"/>,
        /// and other axis format settings.
        /// </remarks>
        /// <param name="baseVal">
        /// The value of the first major tic (floating point double).  This tic value is the base
        /// reference for all tics (including minor ones).
        /// </param>
        /// <param name="iTic">
        /// The major tic number (0 = first major tic).  For log scales, this is the actual power of 10.
        /// </param>
        /// <returns>
        /// The specified minor tic value (floating point double).
        /// </returns>
        private double CalcMinorTicValue( double baseVal, int iTic )
        {
            double[] dLogVal = { 0, 0.301029995663981, 0.477121254719662, 0.602059991327962,
                                    0.698970004336019, 0.778151250383644, 0.845098040014257,
                                    0.903089986991944, 0.954242509439325, 1 };

            if ( this.IsDate ) // date scale
            {
                XDate xDate= new XDate( baseVal );

                switch ( this.minorUnit )
                {
                    case DateUnit.Year:
                    default:
                        xDate.AddYears( (double) iTic * this.minorStep );
                        break;
                    case DateUnit.Month:
                        xDate.AddMonths( (double) iTic * this.minorStep );
                        break;
                    case DateUnit.Day:
                        xDate.AddDays( (double) iTic * this.minorStep );
                        break;
                    case DateUnit.Hour:
                        xDate.AddHours( (double) iTic * this.minorStep );
                        break;
                    case DateUnit.Minute:
                        xDate.AddMinutes( (double) iTic * this.minorStep );
                        break;
                    case DateUnit.Second:
                        xDate.AddSeconds( (double) iTic * this.minorStep );
                        break;
                }

                return xDate.XLDate;
            }
            else if ( this.IsLog ) // log scale
            {
                return baseVal + Math.Floor( (double) iTic / 9.0 ) + dLogVal[ ( iTic + 9 ) % 9 ];
            }
            else // regular linear scale
            {
                return baseVal + (double) this.minorStep * (double) iTic;
            }
        }
开发者ID:InsungChoi,项目名称:dddd,代码行数:61,代码来源:Axis.cs

示例6: CalcMajorTicValue

        /// <summary>
        /// Determine the value for any major tic.
        /// </summary>
        /// <remarks>
        /// This method properly accounts for <see cref="IsLog"/>, <see cref="IsText"/>,
        /// and other axis format settings.
        /// </remarks>
        /// <param name="baseVal">
        /// The value of the first major tic (floating point double)
        /// </param>
        /// <param name="tic">
        /// The major tic number (0 = first major tic).  For log scales, this is the actual power of 10.
        /// </param>
        /// <returns>
        /// The specified major tic value (floating point double).
        /// </returns>
        private double CalcMajorTicValue( double baseVal, double tic )
        {
            if ( this.IsDate ) // date scale
            {
                XDate xDate = new XDate( baseVal );

                switch ( this.majorUnit )
                {
                    case DateUnit.Year:
                    default:
                        xDate.AddYears( tic * this.step );
                        break;
                    case DateUnit.Month:
                        xDate.AddMonths( tic * this.step );
                        break;
                    case DateUnit.Day:
                        xDate.AddDays( tic * this.step );
                        break;
                    case DateUnit.Hour:
                        xDate.AddHours( tic * this.step );
                        break;
                    case DateUnit.Minute:
                        xDate.AddMinutes( tic * this.step );
                        break;
                    case DateUnit.Second:
                        xDate.AddSeconds( tic * this.step );
                        break;
                }

                return xDate.XLDate;
            }
            else if ( this.IsLog ) // log scale
            {
                return baseVal + (double) tic;
            }
            else // regular linear scale
            {
                return baseVal + (double) this.step * tic;
            }
        }
开发者ID:InsungChoi,项目名称:dddd,代码行数:56,代码来源:Axis.cs


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