Change values....

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
ATG
Newbie
Newbie
Posts: 10
Joined: Wed Jun 22, 2005 4:00 am
Contact:

Change values....

Post by ATG » Mon Sep 12, 2005 1:59 pm

Hello,
what I'm trying to do is changing values of the series.
It means that I would like to do something like this:

double[] XS=new double[7];
XS[0]=1000;
XS[1]=2000;
XS[2]=4000;
XS[3]=8000;
XS[4]=16000;
XS[5]=32000;
XS[6]=64000;
atgGraph.Series[0].ValuesLists[1].Clear();
atgGraph.Series[0].ValuesLists[1].Value=XS;
atgGraph.Refresh ();

If the Series[0] allready contains more than 7 elements I get an "index error". Do you know the right way to set the values of the series, even if number of elemnts changes.

Thanks a lot.
Stella Andrea.

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

Post by Narcís » Mon Sep 12, 2005 3:06 pm

Hello Stella,

You'd better use something like the code below using series Clear method and any of the Series.Add overrides that supports arrays.

Code: Select all

		private void button2_Click(object sender, System.EventArgs e)
		{
			double[] XS=new double[7]; 
			XS[0]=1000; 
			XS[1]=2000; 
			XS[2]=4000; 
			XS[3]=8000; 
			XS[4]=16000; 
			XS[5]=32000; 
			XS[6]=64000; 
			atgGraph[0].Clear();
			atgGraph[0].Add(XS);
		}
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