Scrolling ColorGrid

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
HQO
Newbie
Newbie
Posts: 25
Joined: Thu Jun 05, 2003 4:00 am
Contact:

Scrolling ColorGrid

Post by HQO » Thu Feb 08, 2007 12:57 pm

Hi,

I've been trying to implement a 'scrolling' ColorGrid with teeChart v2, that is when new values are added to the colorgrid, the old values from the top should be deleted, so fixed number of rows would always be visible.
What is the recommended way to remove data from colorgrid? I've tried the ColorGrid.Delete method, but it seems to fail with index out of range when e.g. colorGrid1.Delete(0,100,true) is used. When the boolean parameter omitted, that deletes items from two separate locations on the colorgrid (on top and bottom row).

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 Feb 09, 2007 9:39 am

Hi HQO,

I could reproduce the issue here and this seems to be a bug. I've added it (TF02012067) to our defect list to be fixed for future releases.

In the meantime, a workaround can be not removing series rows but modifying left axis scales, for example:

Code: Select all

		private Steema.TeeChart.Styles.ColorGrid colorGrid1;
		private int count = 0;
		private int NumColumns = 10;
		private int NumRows = 10;

		private void Form1_Load(object sender, EventArgs e)
		{
			colorGrid1 = new Steema.TeeChart.Styles.ColorGrid(tChart1.Chart);

			tChart1.Axes.Left.Inverted = true;
			timer1.Enabled = true;
		}

		private void timer1_Tick(object sender, EventArgs e)
		{
			Random Y = new Random();

			for (int x = 0; x < NumColumns; x++)
			{
				colorGrid1.Add(x, Y.Next(1000), count);
			}

			count++;

			if (count > NumRows)
			{
				//colorGrid1.Delete(0, NumColumns);
				tChart1.Axes.Left.SetMinMax(count - NumRows, count);
			}
		}
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