Page 1 of 1

Plotting numeric YValues agaisnt a set of text labels

Posted: Sat Dec 13, 2003 1:01 am
by 9080104
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?

Posted: Mon Dec 15, 2003 6:04 am
by Marc
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

Posted: Mon Dec 15, 2003 4:38 pm
by 9080104
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.

Posted: Tue Dec 16, 2003 11:33 pm
by Marc
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