PDA

View Full Version : Show Product Quantity and Sales


psychobilly1165508
05-28-2010, 08:13 AM
I'm trying to create a chart that shows the individual product sales.

I'm using the standard "orderdetails" table with eCart.

I've tried:
X Label "DetailItemID" group by value
Y Label "DetailPrice" calculation SUM

which shows a chart with the productID.

I tried selecting "show multiple datasets from column" but the chart says "undefined"

How do I get the product name instead of the ID?

Thanks

Jason Byrnes
05-28-2010, 09:44 AM
you would need to modify the recordset that is created to Join the products table to the order detail table to return the product name.


look in the dynamicwebcharts/data folder for the data file it will use the page name it is attached to in the name:
<pagename>_data1.php

send a copy of this file along with the name of the ID and Product name columns from your product table and will help you modify the recordset.

psychobilly1165508
05-28-2010, 11:55 AM
I think I figured out the problem.

The custom recordset works, but the product names have "quotes" on some items. I assume this is causing problems for the flash chart?

Jason Byrnes
05-28-2010, 12:03 PM
yes, quotes will cause issues in the flash chart.



you could use str_replace() to replace the quote"'" with "&quote;" instead
http://php.net/manual/en/function.str-replace.php