Esempio n. 1
0
        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;
        }
Esempio n. 2
0
        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);
            }
        }
Esempio n. 3
0
 /// <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));
 }
Esempio n. 4
0
 /// <summary>
 /// Adds the specified value.
 /// </summary>
 /// <param name="value">The value.</param>
 /// <returns></returns>
 public int Add(DateLinePoint value)
 {
     return(List.Add(value));
 }
Esempio n. 5
0
 /// <summary>
 /// Removes the specified value.
 /// </summary>
 /// <param name="value">The value.</param>
 public void Remove(DateLinePoint value)
 {
     List.Remove(value);
 }
Esempio n. 6
0
 /// <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);
 }
Esempio n. 7
0
 /// <summary>
 /// Indexes the of.
 /// </summary>
 /// <param name="value">The value.</param>
 /// <returns></returns>
 public int IndexOf(DateLinePoint value)
 {
     return(List.IndexOf(value));
 }