Using advanced WebCharts3D features with ColdFusion MX 7

If you want to use some of the advanced features of WebCharts3D with ColdFusion you need to access WebCharts3D via Java API as it is explained in FAQ. The following three custom tags simplify this by providing a familiar interface using custom tags. You can download these tags by clicking here.

Note. In order to initialize charting engine you need to use cfchart tag at least once in your application. If you are planning to do so, remove cfchart tag from chart.cfm file.

Format:

<cf_chart
   format="flash,png,jpg,pdf,svg,"
   chartHeight="height in pixels"
   chartWidth="width in pixels"
   style="absolute path to xml style file"
>

<cf_chartseries
   seriesLabel="label"
   query=query
   itemColumn = "itemColumnName"
   valueColumn= "valueColumnName"
>

<cf_chartdata
    item="text"
    value="number"
>

The tags have fewer parameters than the corresponding cfchart, cfchartseries and cfchartdata tags. All chart's styles should be provided in the xml file defined by chart's style attribute. Another limitation is that if you use cf_chartdata then each series should contain items in the same order.

The following is an few example of using cf_chart tag with cf_chartdata.

<cf_chart
        format="PNG"
        chartwidth ="300"
        chartheight="200"
        style="#GetDirectoryFromPath(GetCurrentTemplatePath())#/myStyle.xml">

      <cf_chartseries type="bar" seriesLabel="Sales">
        <cf_chartdata item="Books" value="160"/>
        <cf_chartdata item="DVD's" value="50"/>
        <cf_chartdata item="Videos" value="215"/>
        <cf_chartdata item="CD's" value="70"/>
        <cf_chartdata item="Magazines" value="85"/>
    </cf_chartseries>
</cf_chart>

The following is an example of using cf_chart with cfquery:

<cfquery name="artistsQuery" datasource="cfcodeexplorer">SELECT *  FROM Orders</cfquery>

<cf_chart
        format="SWF"
        chartwidth ="800"
        chartheight="300"
        style="#GetDirectoryFromPath(GetCurrentTemplatePath())#/myStyle.xml">

<cf_chartseries query=#artistsQuery# itemcolumn="CUSTOMERLASTNAME" valuecolumn="TOTAL" />
</cf_chart>

 

   Copyright © 1994-2009 GreenPoint, Inc. All rights reserved.