<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>CFCHARTDATA</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
   <div id="説明">
   <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">説明</span>
<p>
cfchart タグおよび cfchartseries タグと共に使用します。このタグでは、チャートのデータポイントを定義します。データは、cfchartseries タグに送信されます。 
</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">カテゴリ</span>
<p>
データ出力タグ、拡張タグ
</p>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="syntax"><span class="title">シンタックス</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">関連項目</span>
<p>
cfchart、cfchartseries、『ColdFusion MX 開発ガイド』の第31章の「チャートとグラフの作成」 
</p>

<p>
ColdFusion&#160;MX: このタグが追加されました。
</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">例</span><pre>&lt;!--- 次の例では、cfdocexamples データベース内の給与データを分析し、
部門ごとの平均給与を示す棒グラフを作成します。cfchartseries タグの
本文は、クエリーからの利用可能なデータを含めるために cfchartdata タグを
ループします。 ---&gt;

&lt;!--- 未処理データをデータベースから取得します。 ---&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;!--- クエリーオブクエリーを使用して、各部門の統計データを使用する ---&gt;
&lt;!--- 新規クエリーを生成します。 ---&gt;
&lt;!--- AVG および SUM で統計を計算します。 ---&gt;
&lt;!--- GROUP BY で部門ごとの結果を生成します。 ---&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;!--- 生成された数値を千の位で四捨五入するように形式を設定し直します。 ---&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;従業員の給与の分析&lt;/h1&gt;
&lt;!--- クエリーオブクエリーによる棒グラフです。 ---&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">必須</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>データポイントの名前です。文字列で指定します。</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">必須</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>データポイントの値です。数値または式で指定します。</p>

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

  </body>
</html>
