22.08.2013 Views

ColdFusion Developer's Guide

ColdFusion Developer's Guide

ColdFusion Developer's Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta<br />

You can save the chart as a Flash SWF file, or as a JPEG or PNG image file. If you save the<br />

image as a SWF file, you can pass the variable back to a Flash client using <strong>ColdFusion</strong> Flash<br />

Remoting. For more information, see Chapter 35, “Using the Flash Remoting Service.”<br />

NOTE<br />

If you write the chart to a JPEG or PNG file, mouseover tips and URLs embedded in the<br />

chart for data drill-down do not work when you redisplay the image from the file.<br />

However, if you save the image as a SWF file, both tips and drill-down URLs work. For<br />

more information on data drill-down, see “Linking charts to URLs” on page 1146.<br />

To write a chart to a variable and a file:<br />

1. Create a new <strong>ColdFusion</strong> page with the following content:<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

2. Save the page as chartToFile.cfm in myapps under the web root directory.<br />

3. View the chartToFile.cfm page in your browser.<br />

Reviewing the code<br />

The following table describes the highlighted code and its function:<br />

Code Description<br />

<br />

<br />

<br />

Define a chart written to the myChart variable<br />

using the JPEG format.<br />

Use the tag to write the chart to a file.<br />

Use the HTML img tag to display the chart.<br />

Writing a chart to a variable 1145

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!