
62
Chapter 5 Graphing Data
Graphing Data
One of the most important considerations when you graph data is the way you
supply the data to the
cfgraph
tag. You can supply data in several ways:
•
Provide all the data in a single query.
•
Specify individual data points using
cfgraphdata
tags.
•
Combine data from a query with additional data points from
cfgraphdata
tags.
Note
The
cfgraph
tag graphs 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.
Graphing a query
When you graph a query, you specify the query name in the
cfgraph
tag
query
attribute. In this format the
cfgraph
tag body is empty. However, you must still
provide the
<\cfgraph>
end tag. For example, a simple
cfgraph
tag for a bar chart
might look like this:
<cfgraph type="bar" title="Salaries by Department"
query="DataTable"
itemColumn="Dept_Name"
valueColumn="AvgByDept">
</cfgraph>
This tag displays the values in the AvgByDept column of the DataTable query. It
displays the Dept_Name column value as the item label by each bar. The title
“Salaries by Department” appears above the chart.
The
cfgraph
tag can take the following information from a query:
Attribute
Description
query
The query containing the data.
valueColumn
The query column containing the values to be graphed.
itemColumn
(Optional) The query column containing the description for this data
point. The item normally appears on the horizontal axis of bar and
line graphs, on the vertical axis of horizontal bar graphs, and in the
legend in pie charts.
Содержание COLDFUSION 5-DEVELOPING
Страница 1: ...Macromedia Incorporated Developing ColdFusion Applications MacroMedia ColdFusion 5 ...
Страница 58: ...38 Chapter 3 Querying a Database ...
Страница 134: ...114 Chapter 7 Updating Your Database ...
Страница 210: ...190 Chapter 10 Reusing Code ...
Страница 232: ...212 Chapter 11 Preventing and Handling Errors ...
Страница 238: ...218 Chapter 12 Using the Application Framework ...
Страница 262: ...242 Chapter 12 Using the Application Framework ...
Страница 278: ...258 Chapter 13 Extending ColdFusion Pages with CFML Scripting ...
Страница 320: ...300 Chapter 15 Indexing and Searching Data ...
Страница 336: ...316 Chapter 16 Sending and Receiving E mail ...
Страница 374: ...354 Chapter 18 Interacting with Remote Servers ...