protected override IEnumerable GetDataCore(DataSourceEnvironment environment)
		{
			if (XSequence == null || YSequence == null)
				throw new InvalidOperationException(xAndYShouldNotBeNull);

			IEnumerator<double> xEnumerator = XSequence.GetEnumerator();
			IEnumerator<double> yEnumerator = YSequence.GetEnumerator();

			double xMin = Double.MaxValue;
			double xMax = Double.MinValue;
			double yMin = Double.MaxValue;
			double yMax = Double.MinValue;

			while (xEnumerator.MoveNext() && yEnumerator.MoveNext())
			{
				double x = xEnumerator.Current;
				double y = yEnumerator.Current;

				if (x < xMin)
					xMin = x;
				if (x > xMax)
					xMax = x;
				if (y < yMin)
					yMin = y;
				if (y > yMax)
					yMax = y;

				yield return new Point(x, y);
			}

			environment.ContentBounds = new DataRect(new Point(xMin, yMin), new Point(xMax, yMax));
		}
		protected override IEnumerable GetDataCore(DataSourceEnvironment environment)
		{
			DataRect visible = environment.Visible;
			DataRect realVisible = environment.RealVisible;
			Rect output = environment.Output;
			CoordinateTransform transform = environment.Transform;

			double yMin = Double.PositiveInfinity;
			double yMax = Double.NegativeInfinity;

			double step = visible.Width / output.Width / SamplingRate;

			for (double x = visible.XMin; x <= visible.XMax; x += step)
			{
				double dataX = x;
				double viewportY = func(dataX);

				if (realVisible.HorizontalRange.Contains(dataX))
				{
					if (viewportY < yMin)
						yMin = viewportY;
					if (viewportY > yMax)
						yMax = viewportY;
				}

				yield return new Point(dataX, viewportY);
			}

			DataRect bounds = DataRect.Empty;
			bounds.UnionY(yMin);
			bounds.UnionY(yMax);

			environment.ContentBounds = bounds;
		}
		protected override IEnumerable GetDataCore(DataSourceEnvironment environment)
		{
			var xmlElement = this.xmlElement;
			do
			{
				yield return ((XmlText)xmlElement.FirstChild).Data;
				xmlElement = (XmlElement)xmlElement.NextSibling;
			}
			while (xmlElement != null);
		}
        protected override IEnumerable GetDataCore(DataSourceEnvironment environment)
        {
            var xmlElement = this.xmlElement;

            do
            {
                yield return(((XmlText)xmlElement.FirstChild).Data);

                xmlElement = (XmlElement)xmlElement.NextSibling;
            }while (xmlElement != null);
        }
		/// <summary>
		/// Creates the environment.
		/// </summary>
		/// <param name="viewport">The viewport.</param>
		/// <returns></returns>
		public override DataSourceEnvironment CreateEnvironment(Viewport2D viewport)
		{
			DataSourceEnvironment result = new DataSourceEnvironment
			{
				Output = viewport.Output,
				Visible = viewport.Visible,
				RealVisible = viewport.Visible,
				Transform = viewport.Transform
			};

			return result;
		}
        protected override IEnumerable GetDataCore(DataSourceEnvironment environment)
        {
            int width  = dataSource.Width;
            int height = dataSource.Height;

            for (int ix = 0; ix < width; ix++)
            {
                for (int iy = 0; iy < height; iy++)
                {
                    Point position = dataSource.Grid[ix, iy];
                    T     data     = dataSource.Data[ix, iy];

                    DataSource2DPiece <T> piece = new DataSource2DPiece <T> {
                        Position = position, Data = data
                    };
                    yield return(piece);
                }
            }
        }
Exemple #7
0
        /// <summary>
        /// Gets the data, used by marker chart.
        /// </summary>
        /// <param name="environment">The environment.</param>
        /// <returns></returns>
        public IEnumerable GetData(DataSourceEnvironment environment)
        {
            IEnumerable data = GetDataCore(environment);

            return(data);
        }
 protected override IEnumerable GetDataCore(DataSourceEnvironment environment)
 {
     throw new NotImplementedException();
 }
		protected override IEnumerable GetDataCore(DataSourceEnvironment environment)
		{
			// todo possibly implement better logic here

			return collection;
		}
		protected override IEnumerable GetDataCore(DataSourceEnvironment environment)
		{
			throw new NotImplementedException();
		}
 protected override IEnumerable GetDataCore(DataSourceEnvironment environment)
 {
     return(collection);
 }
		/// <summary>
		/// Gets the point data, used by line chart.
		/// </summary>
		/// <param name="environment">The environment.</param>
		/// <returns></returns>
		public IEnumerable<Point> GetPointData(DataSourceEnvironment environment)
		{
			IEnumerable data = GetDataCore(environment);

			return data.Cast<object>().Select(o => DataToPoint(o));
		}
 protected override IEnumerable GetDataCore(DataSourceEnvironment environment)
 {
     return(new CompositeEnumerable(parts));
 }
        protected override IEnumerable GetDataCore(DataSourceEnvironment environment)
        {
            // todo possibly implement better logic here

            return(collection);
        }
Exemple #15
0
 /// <summary>
 /// Core method for getting data.
 /// </summary>
 /// <param name="environment">The environment.</param>
 /// <returns></returns>
 protected abstract IEnumerable GetDataCore(DataSourceEnvironment environment);
Exemple #16
0
        /// <summary>
        /// Gets the point data, used by line chart.
        /// </summary>
        /// <param name="environment">The environment.</param>
        /// <returns></returns>
        public IEnumerable <Point> GetPointData(DataSourceEnvironment environment)
        {
            IEnumerable data = GetDataCore(environment);

            return(data.Cast <object>().Select(o => DataToPoint(o)));
        }
		public static IEnumerable<Point> GetPoints(this PointDataSourceBase dataSource, DataSourceEnvironment environment)
		{
			return dataSource.GetData(environment).Cast<object>().Select(o => dataSource.DataToPoint(o));
		}
		protected override IEnumerable GetDataCore(DataSourceEnvironment environment)
		{
			return collection;
		}
		protected override IEnumerable GetDataCore(DataSourceEnvironment environment)
		{
			return new CompositeEnumerable(parts);
		}
		protected override System.Collections.IEnumerable GetDataCore(DataSourceEnvironment environment)
		{
			yield return new Point();
			yield return new Point();
		}
		/// <summary>
		/// Core method for getting data.
		/// </summary>
		/// <param name="environment">The environment.</param>
		/// <returns></returns>
		protected abstract IEnumerable GetDataCore(DataSourceEnvironment environment);
		protected override IEnumerable GetDataCore(DataSourceEnvironment environment)
		{
			return Enumerable.Empty<Point>();
		}
		/// <summary>
		/// Gets the data, used by marker chart.
		/// </summary>
		/// <param name="environment">The environment.</param>
		/// <returns></returns>
		public IEnumerable GetData(DataSourceEnvironment environment)
		{
			IEnumerable data = GetDataCore(environment);

			return data;
		}