本文整理汇总了C#中Data.GetClose方法的典型用法代码示例。如果您正苦于以下问题:C# Data.GetClose方法的具体用法?C# Data.GetClose怎么用?C# Data.GetClose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Data
的用法示例。
在下文中一共展示了Data.GetClose方法的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 (fromIdx >= toIdx) // DrawLines needs at least 2 elements to draw line
return;
System.Drawing.Pen pen = new Pen(UpColor, bars.BarsData.ChartStyle.BarWidthUI);
System.Collections.ArrayList points = new System.Collections.ArrayList();
if (fromIdx > 0) fromIdx--;
if (toIdx < bars.Count - 1) toIdx++;
for (int idx = fromIdx; idx <= toIdx; idx++)
{
int x = chartControl.GetXByBarIdx(bars, idx);
Point point = new Point(x, chartControl.GetYByValue(bars, bars.GetClose(idx)));
points.Add(point);
}
if (points.Count == 0)
return;
System.Drawing.Drawing2D.SmoothingMode oldSmoothingMode = graphics.SmoothingMode;
graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
graphics.DrawLines(pen, (Point[])points.ToArray(typeof(Point)));
graphics.SmoothingMode = oldSmoothingMode;
}