Plotting numeric YValues agaisnt a set of text labels

TeeChart for ActiveX, COM and ASP
Post Reply
emckinlay
Newbie
Newbie
Posts: 2
Joined: Thu Dec 04, 2003 5:00 am

Plotting numeric YValues agaisnt a set of text labels

Post by emckinlay » Sat Dec 13, 2003 1:01 am

I am trying to plot some data values against a set of text labels. Basically the Y value is numeric and the X value is a label. So my data might look like:

XValue YValue
-------- --------
Cats 25
Dogs 15
Newts 14

The X and Y values are in an ado recordset. I am sure this is easy but I can't seem to find how to do it. Any advice?

Marc
Site Admin
Site Admin
Posts: 1271
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Mon Dec 15, 2003 6:04 am

Hello,

See the TeeChart Visual Basic 'ADO Databases' example under the VB Examples folder.

eg. syntax:

Code: Select all

Dim Data As New ADODB.Connection
Dim Record As New ADODB.Recordset

  ' Open the sample table and database...
  ' The "TeeChart Pro Database" ODBC DSN is
  ' automatically added when installing TeeChart Pro...
  Data.Open "TeeChart Pro Database"
  Record.Open "employee", Data, 1, 1

  ' Retrieve records....
  TChart1.Series(0).Clear

  TChart1.Series(0).DataSource = Record
  TChart1.Series(0).YValues.ValueSource = Record.Fields(1).Name
  TChart1.Series(0).LabelsSource = Record.Fields(0).Name
LabelsSource would in this case point to your X data.

Regards,
Marc Meumann
Steema Support

emckinlay
Newbie
Newbie
Posts: 2
Joined: Thu Dec 04, 2003 5:00 am

Post by emckinlay » Mon Dec 15, 2003 4:38 pm

Marc,
Thanks for the quick response. I figured it was something simple.
BTW: It would really help if you guys supplied a user guide for TChart. The docs for methods and properties are fine but it is really difficult to figure out which object to use.

Marc
Site Admin
Site Admin
Posts: 1271
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Tue Dec 16, 2003 11:33 pm

Hello,

Thanks for the comments. There are some pointers to db access in the Tutorials (see Tutorial 8 - ADO Database access). The UserGuide is included in the online helpfile (best to look at the contents of the helpfile for section breakdown). Please check the 'information sources' document as a summary of these and other help sources and of how best to search the TeeChart example projects for any clues you might need.

All the above help sources are available via the TeeChart Program Manager menu group.

Regards,
Marc Meumann
Steema Support

Post Reply