Hi all,

Trying to switch my charts finally from the old Allaire Java applets to the
new CFCHART ones.  I am using CFMX 6.1 with CFCHART and CFCHARTSERIES to
show total sales for each sales rep for the current day. It is a Bar graph
style outputting flash content and specifying the query parameter in the
cfchartseries tag.

Problem is, I want each bar on the bargraph to be a different color, but it
seems to ignore my barcolor parameter even thought it is valud a fieldname
in the database. Any suggestions would be appreciated.

Here is my code:
  <cfquery name="GetTotals" datasource="#datasource#">
SELECT smuser.id,
smuser.id,
smuser.name,
smuser.barcolor,
sum(orders.Total) As SumSales
FROM smuser,orders
where smuser.id = Orders.salesrepid
and (orders.odate >= #CreateODBCDateTime(start_date)#
  and orders.odate <= #CreateODBCDateTime(end_date)#)
  AND completed=1
group by smuser.id,smuser.name,smuser.barcolor
</cfquery>

<cfloop index = "i" from = "1" to = "#GetTotals.RecordCount#">
<cfset DataTable.sumSal[i] =
#Replace(DollarFormat(GetTotals.SumSales[i]), '$','')#>
</cfloop>

<cfsavecontent variable="graph_data">
<!--- Generate the graph --->
<cfchart format="flash"
xaxistitle="Sales Rep"
yaxistitle="Dollar Amount"
show3d="yes"
labelFormat="currency"
foregroundColor="##333333"
chartheight="250"
chartwidth="480"
backgroundcolor="#color_table_background2#">
<cfchartseries type="bar"
query="Gettotals"
itemcolumn="name"
valuecolumn="SumSales">
</cfchartseries>
</cfchart>
  </cfsavecontent>
<!--- Stop saving output--->
<!--- Change the swflash.cab codebase location from
the Macromedia URL for the unsecure site to the
secure site --->
<cfset graph_data = Replace(graph_data,"http://","https://") >

<!--- Now output the graph --->
<cfoutput>#graph_data#</cfoutput>

Thanks for any help you can provide,

Dustin Snell
Unisyn Software, LLC
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to