本文整理汇总了C#中DataSeries.Get方法的典型用法代码示例。如果您正苦于以下问题:C# DataSeries.Get方法的具体用法?C# DataSeries.Get怎么用?C# DataSeries.Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataSeries
的用法示例。
在下文中一共展示了DataSeries.Get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawColorLine
public void DrawColorLine(Graphics graphics, Rectangle bounds, double min, double max, DataSeries series, Pen upPen, Pen downPen)
{
if (Bars == null) return;
int barPaintWidth = ChartControl.ChartStyle.GetBarPaintWidth(ChartControl.BarWidth);
SmoothingMode smoothingMode = graphics.SmoothingMode;
int num2 = -1;
int num3 = -1;
Pen pen = null;
GraphicsPath path = null;
for (int i = 0;
i <= (Math.Min(ChartControl.BarsPainted, series.Count - ChartControl.FirstBarPainted) - 1);
i++)
{
int index = ((ChartControl.LastBarPainted - ChartControl.BarsPainted) + 1) + i;
if (ChartControl.ShowBarsRequired || ((index - Displacement) >= BarsRequired))
{
double d = series.Get(index);
if (!double.IsNaN(d))
{
int num7 = (((ChartControl.CanvasRight - ChartControl.BarMarginRight) - (barPaintWidth / 2)) -
((ChartControl.BarsPainted - 1) * ChartControl.BarSpace)) + (i * ChartControl.BarSpace);
int num8 = (bounds.Y + bounds.Height) - ((int)(((d - min) / ChartControl.MaxMinusMin(max, min)) * bounds.Height));
if (num2 >= 0)
{
Pen pen2 = (d > 0.0) ? upPen : downPen;
if (pen2 != pen)
{
if (path != null)
if (pen != null) graphics.DrawPath(pen, path);
path = new GraphicsPath();
pen = pen2;
}
if (path != null) path.AddLine(num2, num3, num7, num8);
}
num2 = num7;
num3 = num8;
}
if (pen != null)
{
graphics.SmoothingMode = SmoothingMode.AntiAlias;
graphics.DrawPath(pen, path);
graphics.SmoothingMode = smoothingMode;
}
}
}
}
示例2: GetSlope
public static int GetSlope(Indicator ind, DataSeries series, int index)
{
return !series.ContainsValue(3) ? 0 : (int)((57.295779513082323 * Math.Atan(((series.Get(index) - ((series.Get(index + 1) + series.Get(index + 2)) / 2.0)) / 1.5) / ind.TickSize)) * -1.0);
}
示例3: DrawValueString
public static void DrawValueString(Indicator ind, Graphics graphics, Rectangle bounds, string plotName, int plotNum, DataSeries series, int boxNum)
{
int num2 = ind.CalculateOnBarClose ? (ind.ChartControl.BarsPainted - 2) : (ind.ChartControl.BarsPainted - 1);
if (ind.Bars != null)
{
int index = ((ind.ChartControl.LastBarPainted - ind.ChartControl.BarsPainted) - 1) + num2;
if (ind.ChartControl.ShowBarsRequired || ((index - ind.Displacement) >= ind.BarsRequired))
{
double num3 = series.Get(index);
string s = plotName + ": ";
StringBuilder builder = new StringBuilder();
builder.Append(Math.Round(num3, 3).ToString(CultureInfo.InvariantCulture));
Color color = (num3 > 0.0) ? upColor : downColor;
textBrush.Color = color;
Brush brush = textBrush;
if (plotNum != -1)
{
if (ind.Plots[plotNum] == null)
s = "Err: Plot Does not exsit!";
else
brush = (ind.Plots[plotNum].Pen.Color == Color.Transparent) ? textBrush : ind.Plots[plotNum].Pen.Brush;
}
graphics.DrawString(s, textFont, brush, (bounds.X + bounds.Width) - 37, (bounds.Y + bounds.Height) - (boxNum * 20), stringFormat);
graphics.DrawString(builder.ToString(), textFont, textBrush, (bounds.X + bounds.Width) - 3, (bounds.Y + bounds.Height) - (boxNum * 20), stringFormat);
}
}
}