PDA

View Full Version : create web charts count


mr hankey
02-22-2010, 02:37 PM
hi,

i have a product table which has the company name of the product provider in it.

i want to display a bar graph to show how many products the user who has logged in has sold?

my table structure is:

ProdID
ProdName
Amount
DatePaid
Clients_clientid = foreign key to clients tbl which has a foreign key to users table.

can someone help?

many thanks

Dani Chankhour
02-23-2010, 11:45 AM
The first step would be to filter based on the the Clients_clientid, and depending on how you are going to filter (either by a url string or a session), in Dynamic Web Charts on the Data tab, there is a filtering and sorting options where you can select the column to filter. In your case that would be your Clients_clientid column. And then under the X Label there is a Group By option which you need to add, and then under the Y Value there is a calculation drop down list and from that you select the Count function. That should give you how many products a user have sold.

mr hankey
02-23-2010, 12:13 PM
thanks dani, how can i have it so it shows the client name from the clients table rather than the fk client_clientid on the page?

many thanks

Dani Chankhour
02-23-2010, 07:15 PM
I'm not sure there is a way you could do this through the Wizard. But you should be able to accomplish this by modifying the query manually.

In the DynamicWebChart folder, there is a data folder and inside that folder there should be a file named as follow: <your page name>_data1.php. When you open the file you should see a record set that is used to populate the chart and you should be able to modify it to get the result that you want. However, this is going to require some custom coding using Join to get the client name. If you post back with how the query i will try to help you in getting the query to return the client name.