private void MapAndAddTrendLine() { if (dateLineGraph.DateTrendLine == null || dateLineGraph.DateTrendLine.DatePoints == null || dateLineGraph.DateTrendLine.DatePoints.Count <= 0) { return; } DateLine trendLine = dateLineGraph.DateTrendLine; trendLine.Points = new LinePointCollection(); for (int j = 0; j < trendLine.DatePoints.Count; j++) { DateLinePoint point = trendLine.DatePoints[j]; DateTime date = point.Date; TimeSpan ts = date - startDate; if (dateMode == DateMode.Day || dateMode == DateMode.HalfDay) { point.XValue = ts.Hours; } else { point.XValue = ts.Days; } trendLine.Points.Add(point); } dateLineGraph.TrendLine = trendLine; }
private void MapAndAddLines() { dateLineGraph.Lines = new LineCollection(); // Map dates to X Values for (int i = 0; i < dateLineGraph.DateLines.Count; i++) { DateLine dateLine = dateLineGraph.DateLines[i]; dateLine.Points = new LinePointCollection(); for (int j = 0; j < dateLine.DatePoints.Count; j++) { DateLinePoint point = dateLine.DatePoints[j]; DateTime date = point.Date; TimeSpan ts = date - startDate; if (dateMode == DateMode.Day || dateMode == DateMode.HalfDay) { point.XValue = ts.Hours; } else { point.XValue = ts.Days; } dateLine.Points.Add(point); } dateLineGraph.Lines.Add(dateLine); } }
/// <summary> /// Determines whether [contains] [the specified value]. /// </summary> /// <param name="value">The value.</param> /// <returns> /// <c>true</c> if [contains] [the specified value]; otherwise, <c>false</c>. /// </returns> public bool Contains(DateLinePoint value) { return(List.Contains(value)); }
/// <summary> /// Adds the specified value. /// </summary> /// <param name="value">The value.</param> /// <returns></returns> public int Add(DateLinePoint value) { return(List.Add(value)); }
/// <summary> /// Removes the specified value. /// </summary> /// <param name="value">The value.</param> public void Remove(DateLinePoint value) { List.Remove(value); }
/// <summary> /// Inserts the specified index. /// </summary> /// <param name="index">The index.</param> /// <param name="value">The value.</param> public void Insert(int index, DateLinePoint value) { List.Insert(index, value); }
/// <summary> /// Indexes the of. /// </summary> /// <param name="value">The value.</param> /// <returns></returns> public int IndexOf(DateLinePoint value) { return(List.IndexOf(value)); }