From: wmohns on
I need to generate a small static website comprised of graphs (generated with
cfchart). The content for the pages will only update every couple of months
when we get new data, so I'd like to setup a coldfusion page that I can run
every time we get new data. For the moment the site has to be static (long
story).

This is pretty straightforward using cfsavecontent and cffile="write" (and
looping over some queries) with one exception. What I cannot figure out how to
do is to can the charts WITH the tips that display the values of points on the
graph on mouseover.

So my question is: is there a way to do this with the Tips?

I can of course run cfchart with the name parameter and then write the chart
to a file, and that works, but then I don't have the tips. If I try to
generate the chart with tips (and save the code using cfsavecontent), then the
tips reference a temporary cached version of the chart image file and I don't
see anyway to control what image file they reference.

Any thoughts?

From: editcorp on
Can you simply cfcache the page?

Regards,
Michael
--
From: Azadi on
when you use name='somename' attribute in cfchart and then save the file
with cffile as .swf (flash) file, all your tips will be preserved.

you can then easily include these .swf files into your static pages...

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
From: BKBK on
Wmohns wrote:
[i]I need to generate a small static website comprised of graphs (generated
with cfchart). ... This is pretty straightforward using cfsavecontent and
cffile="write" [/i]

Everything makes sense to me, except the use of [i]cfsavecontent[/i]. I don't
see the need. Besides that, you seem to have already done what Azadi suggests.

I would suggest the following:

1) Save your flash chart separately from other content. As you already know,
it goes like this

<cfchart format="flash" name="myChart">
</cfchart>

<cffile
action="WRITE"
file="c:\coldfusion8\wwwroot\charts\myFlashChart.swf"
output="#myChart#">

This assumes the directory c:\coldfusion8\wwwroot\charts\ exists.

2) Display the saved chart using the object tag, thus

<OBJECT
WIDTH="550"
HEIGHT="400"
id="myMovieName">
<PARAM NAME="movie" VALUE="myFlashChart.swf">
<PARAM NAME="quality" VALUE="high">
<PARAM NAME="bgcolor" VALUE="#FFFFFF">
<EMBED src="c:\coldfusion8\wwwroot\charts\myFlashChart.swf"
quality="high"
bgcolor="#FFFFFF"
WIDTH="550"
HEIGHT="400"
NAME="myMovieName"
ALIGN=""
TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>



From: wmohns on
My bad. I forgot to mention one other important restriction that I am faced
with: I am not allowed to use flash.

So I am generating the charts as PNG files, and using the cfsavecontent to
save all of the other html surrounding the chart, including the code that
provides the Tips. Thank you very much for the quick responses.

Any more thoughts?