Solved

DB Chart Axis Components from ADO

Posted on 2006-11-22
3
418 Views
Last Modified: 2010-04-05
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!
0
Comment
Question by:Chipmunk77
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
calinutz earned 125 total points
ID: 18003560
ADOQuery1Company is the name of the field assigned by delphi when you access the ADOQuery in the Object Treeview and on right click select Add all fields.
When you do that all the fields returned by your query (written in design time) will appear there in a fieldname, that usually looks like this:
queryfieldname1, queryfieldname2... and so on... depending on what fields you return with your query.


So a short example:
Query name='myquery'
Query= 'select name, address, date, day from table1'
// now when you go to Object treeview and right click on your query component, choose Add All Fields, and your automatic fields will appear bellow in the treeview as follows:
myqueryname,myqueryaddress,myquerydate,myqueryday

Do you understand now?

0
 
LVL 11

Expert Comment

by:calinutz
ID: 18003611
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
0
 

Author Comment

by:Chipmunk77
ID: 18020021
Thanks!  I understand now, that will be very helpful!  :-)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question