<html>
<head>
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>CFCHARTDATA</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
   <div id="Description">
   <table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
      <tr> 
         <td valign="top" class="name">CFCHARTDATA</td>
         <td valign="top" nowrap class="compatibility">&nbsp;</td>
      </tr>
      <tr>
         <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
      </tr>


    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Description</span>
<p>
Used with the cfchart and cfchartseries tags. This tag defines chart data points. Its data is submitted to the cfchartseries tag. 
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Category</span>
<p>
Data output tags, Extensibility tags
</p>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="syntax"><span class="title">Syntax</span><pre>&lt;cfchartdata 
   item = &quot;text&quot; 
   value = &quot;number&quot;&gt;
</pre>    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">See also</span>
<p>
cfchart, cfchartseries; Chapter&#160;31, "Creating Charts and Graphs," in ColdFusion MX Developer's Guide
</p>

<p>
ColdFusion&#160;MX: Added this tag.
</p>

<p>

</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Example</span><pre>&lt;!--- The following example analyzes the salary data in the cfdocexamples
database and generates a bar chart showing average salary by department. The
body of the cfchartseries tag loops over a cfchartdata tag to include data
available from the query. ---&gt;

&lt;!--- Get the raw data from the database. ---&gt;
&lt;cfquery name=&quot;GetSalaries&quot; datasource=&quot;cfdocexamples&quot;&gt;
SELECT Departmt.Dept_Name, 
Employee.Dept_ID, 
Employee.Salary
FROM Departmt, Employee
WHERE Departmt.Dept_ID = Employee.Dept_ID
&lt;/cfquery&gt;

&lt;!--- Use a query of queries to generate a new query with ---&gt;
&lt;!--- statistical data for each department. ---&gt;
&lt;!--- AVG and SUM calculate statistics. ---&gt;
&lt;!--- GROUP BY generates results for each department. ---&gt;
&lt;cfquery dbtype = &quot;query&quot; name = &quot;DataTable&quot;&gt;
SELECT 
Dept_Name,
AVG(Salary) AS avgSal,
SUM(Salary) AS sumSal
FROM GetSalaries
GROUP BY Dept_Name
&lt;/cfquery&gt;

&lt;!--- Reformat the generated numbers to show only thousands. ---&gt;
&lt;cfloop index = &quot;i&quot; from = &quot;1&quot; to = &quot;#DataTable.RecordCount#&quot;&gt;
&lt;cfset DataTable.sumSal[i] = Round(DataTable.sumSal[i]/1000)*1000&gt;
&lt;cfset DataTable.avgSal[i] = Round(DataTable.avgSal[i]/1000)*1000&gt;
&lt;/cfloop&gt;

&lt;h1&gt;Employee Salary Analysis&lt;/h1&gt; 
&lt;!--- Bar graph, from Query of Queries. ---&gt;
&lt;cfchart format=&quot;flash&quot; 
xaxistitle=&quot;Department&quot; 
yaxistitle=&quot;Salary Average&quot;&gt; 

&lt;cfchartseries type=&quot;bar&quot; 
itemcolumn=&quot;Dept_Name&quot; 
valuecolumn=&quot;avgSal&quot;&gt;

&lt;cfloop query=&quot;DataTable&quot;&gt;
&lt;cfchartdata item=&quot;#DataTable.Dept_Name#&quot; value=&quot;#DataTable.avgSal#&quot;&gt;
&lt;/cfloop&gt;

&lt;/cfchartseries&gt;
&lt;/cfchart&gt; 
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="ITEM">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">ITEM</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">Required</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>Data point name; string.</p>

  </td>
  </tr>
  </table>
</div>
<div id="VALUE">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">VALUE</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">Required</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>Data point value; number or expression.</p>

  </td>
  </tr>
  </table>
</div>

  </body>
</html>
