plot x AND y axis values.

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
cs_ech
Newbie
Newbie
Posts: 14
Joined: Mon Oct 02, 2006 12:00 am

plot x AND y axis values.

Post by cs_ech » Thu Oct 22, 2009 7:28 pm

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.

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: plot x AND y axis values.

Post by Yeray » Fri Oct 23, 2009 8:18 am

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply