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


C# Data.GetHigh方法代码示例

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


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

示例1: PaintBars

		/// <summary>
		/// </summary>
		/// <param name="chartControl"></param>
		/// <param name="graphics"></param>
		/// <param name="bars"></param>
		/// <param name="panelIdx"></param>
		/// <param name="fromIdx"></param>
		/// <param name="toIdx"></param>
		/// <param name="bounds"></param>
		/// <param name="max"></param>
		/// <param name="min"></param>
		public override void PaintBars(ChartControl chartControl, Graphics graphics, Data.Bars bars, int panelIdx, int fromIdx, int toIdx, Rectangle bounds, double max, double min)
		{	
			if (downPen.Color != DownColor)
				downPen.Color = DownColor;

			if (upPen.Color != UpColor)
				upPen.Color = UpColor;

			Color	barColor;
			int		barWidth		= bars.BarsData.ChartStyle.BarWidthUI;
			Color	ellipseColor	= UpColor;
			int		high;
			int		low;
			Color	oldColor;
			Pen		pen;
			int		penHalfWidth;
			int		penWidth;
			int		x;

			if (Math.Max(1, barWidth) != upPen.Width)
			{
				downPen		= new Pen(DownColor, Math.Max(1, barWidth));
				upPen		= new Pen(UpColor, Math.Max(1, barWidth));
			}

			for (int idx = fromIdx; idx <= toIdx; idx++)
			{
				barColor		= chartControl.GetBarOverrideColor(bars, idx);
				x				= chartControl.GetXByBarIdx(bars, idx);
				high			= chartControl.GetYByValue(bars, bars.GetHigh(idx));
				low				= chartControl.GetYByValue(bars, bars.GetLow(idx));
				pen				= (bars.GetClose(idx) >= bars.GetOpen(idx) ? upPen : downPen);
				oldColor		= pen.Color;
				penWidth		= (int)pen.Width;
				penHalfWidth	= (int)(pen.Width / 2);
				ellipseColor	= UpColor;

				if (barColor != Color.Empty)
				{
					pen.Color = barColor;
					ellipseColor = barColor;
				}

				if (high == low)
				{
					SolidBrush tmpBrush = new SolidBrush(ellipseColor);
					graphics.FillEllipse(tmpBrush, x - penHalfWidth - 1, Math.Min(high, low) - penHalfWidth - 1, pen.Width + 1, pen.Width + 1);
					tmpBrush.Dispose();
				}
				else
					graphics.DrawLine(pen, x, Math.Min(high, low) - penHalfWidth, x, Math.Max(high, low) + penHalfWidth);

				if (barColor != Color.Empty)
					pen.Color = oldColor;
			}
		}
开发者ID:kbh0001,项目名称:kennt-stuff,代码行数:67,代码来源:ChartStyles.cs


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