Link to home
Start Free TrialLog in
Avatar of Chipmunk77
Chipmunk77

asked on

DB Chart Axis Components from ADO

Hi all,

I found an article on about.com that helped me figure out how to set the series to a field that does not appear in the code - however, they have a line of code that I do not understand and cannot figure out the equivalent in my app:

with DBChart1.SeriesList.Series[0] do begin
 DataSource := ADOQuery1;
 XLabelsSource := ADOQuery1Company.FieldName;
 XValues.ValueSource := ADOQuery1SumItems.FieldName;
 YValues.ValueSource := '';
 Marks.Style := smsXValue;
 CheckDataSource;


My Query is ADOQuerySalesman and my field is u_name
It does not have full source, so I am not sure what ADOQuery1Company.FieldName is supposed to represent.  I tried using ADOQuerySalesman.u_name, I tried using ADOQuerySalesmanu_name.Fieldname - I'm not sure what that line represents - can anyone help?  Either with this specifically - or any help with DBChart and how to set it up via code

Thanks all!
ASKER CERTIFIED SOLUTION
Avatar of calinutz
calinutz
Flag of Romania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Instead of using the exact demo of the tutorial you could use an alternative to that assignment such as:


with DBChart1.SeriesList.Series[0] do begin
 DataSource := ADOQuery1;
 XLabelsSource :=ADOQuery1.Fields[0].DisplayName;
 XValues.ValueSource := ADOQuery1.Fields[1].DisplayName;
 YValues.ValueSource := '';
 Marks.Style := smsXValue;
 CheckDataSource;



It should work
Avatar of Chipmunk77
Chipmunk77

ASKER

Thanks!  I understand now, that will be very helpful!  :-)