views:

318

answers:

1
+4  A: 

This can be done using custom XML. I ran the Chart Designer (cfinstall/charting/webcharts.bar (or .sh) and simply worked with the YAxis setting. There is an isReversed setting which does what you want. Consider this code:

<cfset q2 = queryNew("year,employees","integer,integer")>
<!--- generate random sales data --->
<cfloop index="y" from="1994" to="1998">
    <cfscript>
    queryAddRow(q2);
    querySetCell(q2, "year", y);
    querySetCell(q2, "employees", randRange(2,8));
    </cfscript>
</cfloop>

<cfsavecontent variable="chartxml">
<?xml version="1.0" encoding="UTF-8"?>
<frameChart is3D="false">
<yAxis isReversed="true">    
</yAxis>
</frameChart>
</cfsavecontent>

<cfchart chartWidth="400" chartHeight="400" title="Sales" font="arial" style="#chartxml#">
    <cfchartseries type="line" query="q2" itemColumn="year" valueColumn="employees" seriesLabel="Employees" />
</cfchart>

The query on top was just used for testing. The XML came from the chart designer. I removed everything but the yAxis stuff that used isReverse. Lastly, note how I specify style in the chart tag.

CF Jedi Master
Thanks! Will play with WebCharts to get needed chart look.
Sergii