wheres everybody gone, you aussies dont like working the weekends do ya!!
i have the code below, how can i sort the structure so that the structur elements
chart.data are sorted by their values.
cheers
Jamie
<cfscript>
reports = createObject("component","reports");
</cfscript>
<cfset chart = StructNew()>
<cfparam name="#url.graphStyle#" default="bar">
<cfinvoke component="#reports#" method="getnumsold" returnvariable="getnumsold">
<cfinvokeargument name="vendorcode" value="#cookie.vid#">
<cfif Isdefined("url.product_id") and url.product_id neq "">
<cfinvokeargument name="product_id" value="#url.product_id#">
</cfif>
</cfinvoke>
<cfif getnumsold.recordcount gt 0>
<cfloop query="getnumsold">
<cfset itemname= "#getnumsold.name#"&"#getnumsold.product_id#">
<cfset chart.data[itemname] = #getnumsold.number_sold#>
</cfloop>
<cfset chart.scalefrom = 0>
<cfset chart.scaleto = 100>
<cfset chart.type = "#url.graphStyle#">
<cfelse>
No items match your search criteria. Please search again
</cfif>
<cfchart format="flash" scalefrom="0" scaleto="100" showborder="yes"
backgroundcolor="##FFFFFF" showlegend="yes" chartwidth="550" chartheight="400"
pieslicestyle="solid">
<cfchartseries type="#chart.type#" serieslabel="Products Sold" seriescolor="##003366">
<cfloop collection="#chart.data#" item="i">
<cfchartdata item="#i#" value="#chart.data[i]#">
</cfloop>
</cfchartseries>
</cfchart>
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004