• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 26.  Drawing Charts  >  Using a Query to Create a Chart

Using a Query to Create a Chart

You can build a chart from the database table by using the <cfquery> tag. To use the database query, you need to create a database and data source name (DSN). The following example is based on the emp database and the empdsn data source. The emp database has an employee table whose columns are empname, salary, department, and incentive. Here’s the syntax to create a query-based chart:

<CFCHART attribute.
.
.
.>
<CFCHARTSERIES TYPE="type"
    QUERY="query to base the chart on"
    VALUECOLUMN="name of the column to use its values."
    ITEMCOLUMN="name of the column to derive labels"
    Any other attributes=
.
.
.
.>
</CFCHARTSERIES>
</CFCHART>


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint