Adobe COLDFUSION 9 Manual page 989

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Working with Documents, Charts, and Reports
Tag
Description
cfchart
Specifies the container in which the chart appears. This container defines the height, width, background color, labels,
fonts, and other characteristics of the chart.
Include at least one
cfchartseries
Specifies a database query that supplies the data to the chart and one or more
individual data points. Specifies the chart type, colors for the chart, and other optional attributes.
cfchartdata
Optionally specifies an individual data point to the
The following example shows an outline of the basic code that you use to create a chart:
<cfchart>
<cfchartseries type="type">
<cfchartdata item="something" value="number">
</cfchartseries>
</chart>
The following example displays a simple pie chart that shows four values:
<cfchart>
<cfchartseries type="pie">
<cfchartdata item="New car sales" value="50000">
<cfchartdata item="Used car sales" value="25000">
<cfchartdata item="Leasing" value="30000">
<cfchartdata item="Service" value="40000">
</cfchartseries>
</cfchart>
Note: If you access charting functionality using Java calls, a watermark 'Developer Edition - Not for Production Use'
might be displayed on the chart images. To avoid this, when you assign the server object to a reference, instead of
svr.getDefaultInstance(getPageContext().getServletContext());)
:
svr=)
svr=svr.getDefaultInstance(getPageContext().getServletContext());)
the server for the changes to take effect.
Creating a chart with the Report Builder wizard
The ColdFusion Report Builder includes a wizard that lets you create charts easily. The wizard lets you specify all of
the chart characteristics that you can specify using the
information about using the Report Builder chart wizard, see
page 1007.
Charting data
One of the most important considerations when you chart data is the way that you supply the data to the cfchart tag.
You can supply data in the following ways:
• Specify individual data points by using cfchartdata tags.
• Provide all the data in a single query by using cfchartseries tags.
• Combine data from a query with additional data points from
• Provide all the data in a report created with Report Builder. For more information, see
Documents for
Printing" on page 1007.
Note: The
tag charts numeric data only. As a result, convert any dates, times, or preformatted currency values,
cfchart
such as $3,000.53, to integers or real numbers.
tag within the
cfchartseries
cfchart
cfchartseries
,
cfchart
cfchartseries
"Creating Reports and Documents for
Last updated 8/5/2010
tag.
cfchartdata
tag.
, use the following code (by prefixing
. Ensure that you restart
, and
cfchartdata
tags.
cfchartdata
"Creating Reports and
984
tags that specify
tags. For
Printing" on

Advertisement

Table of Contents
loading

Table of Contents