本文整理汇总了C#中TimeSeries.GetTrend方法的典型用法代码示例。如果您正苦于以下问题:C# TimeSeries.GetTrend方法的具体用法?C# TimeSeries.GetTrend怎么用?C# TimeSeries.GetTrend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimeSeries
的用法示例。
在下文中一共展示了TimeSeries.GetTrend方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
private void Render(TimeSeries ts)
{
float w = ((float) 180)/ts.Values.Count;
float h = 80.0f;
int margin = 10;
StockPoints = new PointCollection();
for (int i = 1; i < ts.Values.Count; ++i)
{
var p0 = new Point(margin + (i - 1)*w, margin + (1 - ts.Values[i - 1])*h);
var p1 = new Point(margin + i*w, margin + (1 - ts.Values[i])*h);
StockPoints.Add(p0);
StockPoints.Add(p1);
}
if (INDEX_POINTS == null)
{
INDEX_POINTS = new PointCollection();
TimeSeries index = DataCache.Instance.Index;
for (int i = 1; i < index.Values.Count; ++i)
{
var p0 = new Point(margin + (i - 1)*w, margin + (1 - index.Values[i - 1])*h);
var p1 = new Point(margin + i*w, margin + (1 - index.Values[i])*h);
INDEX_POINTS.Add(p0);
INDEX_POINTS.Add(p1);
}
}
MathLine trend = ts.GetTrend();
TrendX1 = margin;
TrendY1 = margin + (1 - trend.GetY(0))*h;
TrendX2 = margin + (ts.Values.Count - 1)*w;
TrendY2 = margin + (1 - trend.GetY(ts.Values.Count - 1))*h;
TrendColor = new SolidColorBrush(GetTrendColor(trend.B));
}