User Guide

Table Of Contents
Charting data 735
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 illustrates 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>
The following figure shows the resulting chart:
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
cfchart,
cfchartseries, and cfchartdata tags. For information about using the Report Builder chart
wizard, see Chapter 32, “Creating Reports for Printing,” on page 763.
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 using cfchartdata tags.
Provide all the data in a single query using cfchartseries tags.
Combine data from a query with additional data points from cfchartdata tags.
Provide all the data in a report created with Report Builder. For more information, see
Chapter 32, “Creating Reports for Printing,” on page 763.
Note: The cfchart tag charts numeric data only. As a result, you must convert any dates, times, or
preformatted currency values, such as $3,000.53, to integers or real numbers.