Problem with DownSampling and TextSource

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Raimund Bruening
Newbie
Newbie
Posts: 1
Joined: Wed May 23, 2007 12:00 am

Problem with DownSampling and TextSource

Post by Raimund Bruening » Fri Jul 04, 2008 10:15 am

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?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Jul 04, 2008 10:38 am

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;
		}
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply