Bar Charts & X Axis

TeeChart for ActiveX, COM and ASP
Post Reply
JobyLeigh
Newbie
Newbie
Posts: 7
Joined: Tue Nov 02, 2010 12:00 am

Bar Charts & X Axis

Post by JobyLeigh » Thu Sep 06, 2012 3:27 pm

Hi there everyone,

Probably doing something really stupid (hopefully...) but I have a database table which I am trying to display in a Bar Chart. Data similar to as follows:

PUPILID PUPILNAME VALUE
1 Ben 15
2 Rob 17
3 Geoff 12
4 Wendy 16
5 Jenny 15

The idea is that VALUE would appear on the Y Axis, and each Bar within the Chart would represent a Pupil. With this in mind, I want the X Axis to say, underneath each Bar, the corresponding Pupil Name. However, whenever I set the XValue.ValueSource to PUPILNAME, it would error with (for example) "'BEN' is not a valid floating point value".

What do I have to turn off or change so the X Axis does not expect a floating point value? Or in order to display this field do I need to do something else entirely?

Thanks in advance.
Ben

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

Re: Bar Charts & X Axis

Post by Yeray » Fri Sep 07, 2012 8:43 am

Hi Ben,

You could set the PUPILNAME to be used as the series Labels, LabelsSource, instead of XValues.ValueSource.
There is an example of how to do something like this in the "Tutorial 8 - ADO Database access".
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

JobyLeigh
Newbie
Newbie
Posts: 7
Joined: Tue Nov 02, 2010 12:00 am

Re: Bar Charts & X Axis

Post by JobyLeigh » Fri Sep 07, 2012 9:43 am

Perfect!
Thanks for your quick response.

Kind regards,
Ben

Post Reply