/// <summary>
        /// Returns the absolute value of the specified percentage value between the specified minimum and maximum values.
        /// </summary>
        /// <param name="min">The minimum.</param>
        /// <param name="max">The maximum.</param>
        /// <param name="percentage">The percentage.</param>
        /// <returns></returns>
        public override IGraphDataPoint ComputeAbsolutePosition(IGraphDataPoint min, IGraphDataPoint max, double percentage)
        {
            int minimum = (int)min.GetValue();
            int maximum = (int)max.GetValue();

            return(new Int32DataPoint((int)(minimum + (maximum - minimum) * percentage)));
        }
示例#2
0
        /// <summary>
        /// Returns the absolute value of the specified percentage value between the specified minimum and maximum values.
        /// </summary>
        /// <param name="min">The minimum.</param>
        /// <param name="max">The maximum.</param>
        /// <param name="percentage">The percentage.</param>
        /// <returns></returns>
        public override IGraphDataPoint ComputeAbsolutePosition(IGraphDataPoint min, IGraphDataPoint max, double percentage)
        {
            double minimum = (double)min.GetValue();
            double maximum = (double)max.GetValue();

            return(new FloatDataPoint((float)(minimum + (maximum - minimum) * percentage)));
        }
        /// <summary>
        /// Returns the absolute value of the specified percentage value between the specified minimum and maximum values.
        /// </summary>
        /// <param name="min">The minimum.</param>
        /// <param name="max">The maximum.</param>
        /// <param name="percentage">The percentage.</param>
        /// <returns></returns>
        public override IGraphDataPoint ComputeAbsolutePosition(IGraphDataPoint min, IGraphDataPoint max, double percentage)
        {
            double minimum = ((TimeSpan)min.GetValue()).TotalMilliseconds;
            double maximum = ((TimeSpan)max.GetValue()).TotalMilliseconds;

            return(new TimeSpanDataPoint(TimeSpan.FromMilliseconds(minimum + (maximum - minimum) * percentage)));
        }
        /// <summary>
        /// Returns the absolute value of the specified percentage value between the specified minimum and maximum values.
        /// </summary>
        /// <param name="min">The minimum.</param>
        /// <param name="max">The maximum.</param>
        /// <param name="percentage">The percentage.</param>
        /// <returns></returns>
        public override IGraphDataPoint ComputeAbsolutePosition(IGraphDataPoint min, IGraphDataPoint max, double percentage)
        {
            double minimum = ((DateTime)min.GetValue()).Ticks;
            double maximum = ((DateTime)max.GetValue()).Ticks;

            return(new DateTimeDataPoint(new DateTime((long)(minimum + (maximum - minimum) * percentage))));
        }
示例#5
0
        /// <summary>
        /// Creates a range of values from the specified minimum and maximum.
        /// </summary>
        /// <param name="min">The minimum.</param>
        /// <param name="max">The maximum.</param>
        /// <param name="count">The count.</param>
        /// <returns></returns>
        public override IEnumerable <IGraphDataPoint> CreateRange(IGraphDataPoint min, IGraphDataPoint max, int count)
        {
            double minimum = (double)min.GetValue();
            double maximum = (double)max.GetValue();

            return(Enumerable.Range(0, count).
                   Select(i => minimum + (maximum - minimum) * ((double)i / (count - 1))).
                   Select(x => new FloatDataPoint((float)x)));
        }
        /// <summary>
        /// Creates a range of values from the specified minimum and maximum.
        /// </summary>
        /// <param name="min">The minimum.</param>
        /// <param name="max">The maximum.</param>
        /// <param name="count">The count.</param>
        /// <returns></returns>
        public override IEnumerable <IGraphDataPoint> CreateRange(IGraphDataPoint min, IGraphDataPoint max, int count)
        {
            int minimum = (int)min.GetValue();
            int maximum = (int)max.GetValue();

            return(Enumerable.Range(0, count).
                   Select(i => minimum + (maximum - minimum) * ((int)i / (count - 1))).
                   Select(x => new Int32DataPoint(x)));
        }
        /// <summary>
        /// Creates a range of values from the specified minimum and maximum.
        /// </summary>
        /// <param name="min">The minimum.</param>
        /// <param name="max">The maximum.</param>
        /// <param name="count">The count.</param>
        /// <returns></returns>
        public override IEnumerable <IGraphDataPoint> CreateRange(IGraphDataPoint min, IGraphDataPoint max, int count)
        {
            double minimum = ((TimeSpan)min.GetValue()).TotalMilliseconds;
            double maximum = ((TimeSpan)max.GetValue()).TotalMilliseconds;

            return(Enumerable.Range(0, count).
                   Select(i => minimum + (maximum - minimum) * ((double)i / (count - 1))).
                   Select(x => new TimeSpanDataPoint(TimeSpan.FromMilliseconds(x))));
        }
        /// <summary>
        /// Creates a range of values from the specified minimum and maximum.
        /// </summary>
        /// <param name="min">The minimum.</param>
        /// <param name="max">The maximum.</param>
        /// <param name="count">The count.</param>
        /// <returns></returns>
        public override IEnumerable <IGraphDataPoint> CreateRange(IGraphDataPoint min, IGraphDataPoint max, int count)
        {
            double minimum = ((DateTime)min.GetValue()).Ticks;
            double maximum = ((DateTime)max.GetValue()).Ticks;

            return(Enumerable.Range(0, count).
                   Select(i => minimum + (maximum - minimum) * ((double)i / (count - 1))).
                   Select(x => new DateTimeDataPoint(new DateTime((long)x))));
        }