Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 994

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Working with Documents, Charts, and Reports
One use of combining queries and data points is to provide data that is missing from the database; for example, to
provide the data for one department if the data for that department is missing. The example in the following procedure
adds data for the Facilities and Documentation departments to the salary data obtained from the query shown in the
previous section:
Open the chartdata.cfm file in your editor.
1
2
Edit the
tag so that it appears as follows:
cfchart
<cfchart chartwidth="600">
<cfchartseries
type="bar"
query="DeptSalaries"
itemColumn ="Dept_Name"
valueColumn="AvgByDept"
>
<cfchartdata item="Facilities" value="35000">
<cfchartdata item="Documentation" value="45000">
</cfchartseries>
</cfchart>
3
Save the page as chartqueryanddata.cfm in the myapps directory under the web root directory. For example, the
directory path in Windows could be C:\Inetpub\wwwroot\myapps.
4
Return to your browser and enter the following URL to view the chartqueryanddata.cfm page:
http://localhost/myapps/chartqueryanddata.cfm
Charting multiple data collections
Sometimes, you could have more than one series of data to display on a single chart, or you want to compare two sets
of data on the same chart. In some cases, you might want to use different charting types on the same chart. For
example, you could include a line chart on a bar chart.
To combine multiple data series into a single chart, insert multiple
You control how the multiple data collections are charted using the
Using this attribute, you can specify the following options:
Let ColdFusion determine the best method for combining the data.
default
Place corresponding chart elements from each series next to each other.
cluster
Combine the corresponding elements of each series.
stacked
Show the elements of each series as a percentage of the total of all corresponding elements.
percent
The following image shows these options for combining two bar charts:
cfchartseries
seriesPlacement
Last updated 1/20/2012
tags within a single
cfchart
attribute of the
cfchart
989
tag.
tag.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents