Page 1 of 1

Problem with DownSampling and TextSource

Posted: Fri Jul 04, 2008 10:15 am
by 45197
Hello together,

I've a problem with the DownSampling Function. When I use it with a Steema.TeeChart.Styles.Points object as DataSource all is working well. But when I change the DataSource to a Steema.TeeChart.Data.TextSource object the DownSampling function does not work.

Any ideas?

Posted: Fri Jul 04, 2008 10:38 am
by narcis
Hi Raimund,

No, you need to use a series for the TextSource and another series for the function. Then you can hide source series, for example:

Code: Select all

		public Form1()
		{
			InitializeComponent();
			InitializeChart();		
		}

		private void InitializeChart()
		{
			tChart1.Aspect.View3D = false;

			Steema.TeeChart.Styles.Points points1 = new Steema.TeeChart.Styles.Points(tChart1.Chart);
			points1.Pointer.HorizSize = 1;
			points1.Pointer.VertSize = 1;
						
			Steema.TeeChart.Functions.DownSampling downSampling1 = new Steema.TeeChart.Functions.DownSampling(tChart1.Chart);
			downSampling1.Method = Steema.TeeChart.Functions.DownSamplingMethod.Average;
			downSampling1.Tolerance = 10.0;

			Steema.TeeChart.Styles.FastLine fastLine1 = new Steema.TeeChart.Styles.FastLine(tChart1.Chart);
			fastLine1.Function = downSampling1;
			fastLine1.DataSource = points1;			

			Steema.TeeChart.Data.TextSource ts = new Steema.TeeChart.Data.TextSource();
			try
			{
				Cursor = Cursors.WaitCursor;
				ts.HeaderLines = 0;
				ts.Separator = ';';
				ts.Series = points1;
				ts.Fields.Add(0, "X");
				ts.Fields.Add(1, "Y");
				ts.LoadFromFile(@"c:\temp\Book1.csv");
			}
			finally
			{
				Cursor = Cursors.Default;
			}

			fastLine1.CheckDataSource();
			points1.Active = false;
		}