Page 1 of 1

plot x AND y axis values.

Posted: Thu Oct 22, 2009 7:28 pm
by 9642625
I need to extract x and y axis values form the database and plot them on a points graph.
The following code plots only y axis values:
points1.Add(rdr[0]);
Please advice.

Re: plot x AND y axis values.

Posted: Fri Oct 23, 2009 8:18 am
by yeray
Hi cs_ech,

There are many overloads of the Add method. You are using this:

Code: Select all

public int Add(double value)
But note that there is also this:

Code: Select all

public int Add(double x, double y)
So, if you have your X Values at rdr[0] and your Y values at rdr[1] you could do:

Code: Select all

points1.Add(rdr[0], rdr[1]);
Please take a look at the Tutorial8 - ADO.NET Database Access (You'll find the tutorials at TeeChart programs group)
You could also take a look at here to see how to use BindingSource, and here to see how to assign a database manually.