User Guide

Table Of Contents
756 Chapter 31: Creating Charts and Graphs
Administering charts
Use the ColdFusion MX Administrator to administer charts. In the Administrator, you can
choose to save cached charts in memory or to disk. You can also specify the number of charts to
cache, the number of charting threads, and the disk file for caching images to disk.
ColdFusion MX 7 caches charts as they are created. In that way, repeated requests of the same
chart load the chart from the cache rather than having ColdFusion render the chart over and over
again.
Note: You do not have to perform any special coding to reference a cached chart. Whenever you use
the
cfchart tag, ColdFusion MX inspects the cache to see if the chart has already been rendered. If
so, ColdFusion MX loads the chart from the cache.
The following table describes the settings for the ColdFusion MX 7 charting and graphing
engine:
Writing a chart to a variable
In some cases, your application might have charts that are static or charts that, because of the
nature of the data input, take a long time to render. In this scenario, you can create a chart and
write it to a variable.
Once written to a variable, other ColdFusion pages can access the variable to display the chart, or
you can write the variable to disk to save the chart to a file. This lets you create or update charts
only as needed, rather than every time someone requests a page that contains a chart.
You use the name attribute of the
cfchart tag to write a chart to a variable. If you specify the
name attribute, the chart is not rendered in the browser but is written to the variable.
You can save the chart as a Flash SWF file, or as a JPEG or PNG image file. If you save the image
as a SWF file, you can pass the variable back to a Flash client using ColdFusion Flash Remoting.
For more information, see Chapter 33, “Using the Flash Remoting Service,” on page 807.
Note: If you write the chart to a JPEG or PNG file, mouseover tips and URLs embedded in the chart
for data drill-down do not work when you redisplay the image from the file. However, if you save the
image as a SWF file, both tips and drill-down URLs work. For more information on data drill-down,
see “Linking charts to URLs” on page 758.
Option Description
Cache Type Sets the cache type. Charts can be cached in memory or to disk. Caching in
memory is faster, but more memory intensive.
Maximum number of
images in cache
Specifies the maximum number of charts to store in the cache. When the
limit is reached, the oldest chart in the cache is deleted to make room for a
new one. The maximum number of charts you can store in the cache is 250.
Max number of
charting threads
Specifies the maximum number of chart requests that can be processed
concurrently. The minimum number is 1 and the maximum is 5. Higher
numbers are more memory-intensive.
Disk cache location When caching to disk, specifies the directory in which to store the
generated charts.