Friday, August 7, 2009

Adding dynamic charts in spreadsheets using ColdFusion 9

Using spreadsheets is a new feature in ColdFusion 9. Do you know how to add dynamic charts in the spreadsheets?
The following code shows how to do it:

<cfchart format="png" scalefrom="-100"
scaleTo="100" gridlines="5"
<cfchartseries type="line">
<cfchartdata item="Point1" value="-50">
<cfchartdata item="Point2" value="-25">
<cfchartdata item="Point3" value="1">

<cfset xlObj = SpreadSheetNew(true)>
<cfset spreadsheetAddImage(xlObj,test,"png","5,5,15,15")>
<cfspreadsheet action="write" name="xlObj" filename="/home/user1/spreadsheet/report1.xlsx">
The following figure shows the output of your effort:

No comments:

Post a Comment