Sagewire Logo

CF8 and CFCHART problem

4 Message(s) by 2 Author(s) originally posted in flash and cfml


From: omega1234 Date:   Friday, July 20, 2007
I could be wrong but it seems to me that Cold Fusion 8 never displays flash
charts when the name is specified, making it impossible to use charts within
cfforms.

ie - won't display:

<CFCHART format="flash" show3d="yes" pieslicestyle="sliced"
labelformat="currency" name="testChart" title="Summary of Revenue">

<CFCHARTSERIES type="pie">
<CFCHARTDATA item="a" value="50">
<CFCHARTDATA item="b" value="100">
<CFCHARTDATA item="c" value="100">
</CFCHARTSERIES>
</CFCHART>

but will:

<CFCHART format="flash" show3d="yes" pieslicestyle="sliced"
labelformat="currency" showmarkers="no" title="Summary of Revenue">

<CFCHARTSERIES type="pie">
<CFCHARTDATA item="a" value="50">
<CFCHARTDATA item="b" value="100">
<CFCHARTDATA item="c" value="100">
</CFCHARTSERIES>
</CFCHART>


From: BKBK Date:   Saturday, July 21, 2007
[i]it seems to me that Cold Fusion 8 never displays flash charts when the name
is specified[/i]

Neither did Cold Fusion MX7, perhaps not even earlier MX versions, either. It
is so by design. Paraphrasing the
http://livedocs.macromedia.com/Cold Fusion/7/htmldocs/00000226.htm,

[i]"[When you specify the name attribute, cfchart] generates the graph as
binary data and assigns it to the specified variable. [Specifying a name]
suppresses chart display. You can use the name value in the CFFILE tag to write
the chart to a file ."[/i]

You could therefore simply extend your code, thus <CFTRY>
<CFCHART format="flash" show3d="yes" pieslicestyle="sliced"
labelformat="currency" name="testChart" title="Summary of Revenue">

<CFCHARTSERIES type="pie">
<CFCHARTDATA item="a" value="50">
<CFCHARTDATA item="b" value="100">
<CFCHARTDATA item="c" value="100">
</CFCHARTSERIES>
</CFCHART>
<!--- create directory if necessary --->
<CFIF NOT directoryExists("c:\temp\test\")>
<CFDIRECTORY action="CREATE" directory="c:\temp\test\">
</CFIF>
<!--- write chart to file --->
<CFFILE action = "write" file = "c:\temp\test\test_chart.swf" output =
"#testChart#">

Chart has been written to c:\temp\test\test_chart.swf
<CFCATCH type="Application">
error occurred: <CFOUTPUT>#cfcatch.message#</CFOUTPUT>
</CFCATCH>
</CFTRY>


From: omega1234 Date:   Saturday, July 21, 2007
Thanks, that's just what I needed. Should've read the docs more carefully.


From: BKBK Date:   Sunday, July 22, 2007
!



Next Message: Flash Form and Navigation Button Issue (DoFSCommand)



Programming | Sports | Autos

copyright 2006
Valid XHTML 1.0 Transitional