Page 1 of 1

Change values....

Posted: Mon Sep 12, 2005 1:59 pm
by 9637269
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.

Posted: Mon Sep 12, 2005 3:06 pm
by narcis
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);
		}