Whatever message this page gives is out now! Go check it out!

cfchartset

Last update:
May 18, 2026

Description

The cfchartset tag in ColdFusion allows ColdFusion developers and chart creators to handle complex data visualizations with multiple, distinct charts within a single container. Here are a few reasons to consider using the cfchartset tag in ColdFusion:
  • Multiple charts: Cfchartset allows you to create multiple charts, which is useful when comparing related visualizations side-by-side and displaying different views of the data, for example, pie or bar charts.
  • Uniform updates: Cfchartset allows you to view all your chart configurations in one place. This means it’s easier to create and maintain the charts, reducing redundancy.
  • Better layouts: Cfchartset makes it easier to create complex layouts involving multiple charts, so you can define the position and size of the charts precisely. Additionally, you can arrange charts in grids, columns, or any other layout suitable for your data presentation needs.
The cfchartset tag is particularly useful in scenarios, such as, a one-stop dashboard for a unified view of key metrics, multi-metric analysis to identify trends or correlations, or a comparative analysis visualizing data in a unified view.
The cfchartset tag defines the width and height of the container and the layout of the charts inside the container. In the cfchartset tag, you can fit charts using cfchart, in a pre-defined layout in the cfchartset tag.

Syntax

<cfchartset  
    format="html/png/jpg/svg"
    layout="horizontal/vertical/n row x m cols"
    renderer="svg/canvas/vml"
    height="height of the container in pixels or height in percentage"
    width="width of the container in pixels or width in percentage"
    name="the name given to the container"
>
Note:
  • If it is a client-side chart, both pixel and percentage is applicable to width and height of the chart.
  • If it is a server-side chart, only pixel is applicable to width and height of the chart.

History

  • ColdFusion (2025 release): Added the tag.

Attributes

Attribute
Required
Type
Default
Description
name
No
String
None
If you set a variable as a name, the output will be stored in that variable. This function generates the graph as binary data and assigns it to the specified variable. It suppresses the chart display.
You can use the name value in the cffile tag to write the chart to a file.
Note: The attribute stores the chart in a variable. Only applies to non-HTML charts.
layout
No
String
None. It adjusts all charts in the container using the default size.
Defines how you’d arrange the charts in the cfchart container. The available options are:
  • horizontal
  • vertical
  • r x c (rows x columns)
format
No
String
png
File format in which to save the graph. The available formats are:
  • html
  • png
  • jpg
  • svg
renderer
No
String
Depends on valuesdefined
Specify the rendering method. The supported values are:
  • svg
  • canvas
  • vml
height
No
Integer
240
Chartset container height in pixels.
width
No
Integer
320
Chartset container width in pixels.
base64
No
Boolean
False
This attribute is used for server-side charting.

Examples

Example 1- 3 rows and 2 columns
This following script creates a 3x2 layout of five charts using <cfchartset>. Each chart visualizes data for two companies, Acme Inc. and CFX Tech, with values for Day 1 and Day 2.
code
<cfchartset format="html" layout="3x2" height="1000" width="1000" name="first viz">     
    <cfchart type="bar" title="Two-series bar chart" plotarea = "#{"margin"="dynamic"}#" showlegend="yes"> 
        <cfchartseries serieslabel="Acme Inc." markerstyle="circle" color="##0aaa8f"> 
            <cfchartdata item="Day 1" value="19.2"/> 
            <cfchartdata item="Day 2" value="15.2"/> 
        </cfchartseries> 
        <cfchartseries serieslabel="CFX Tech" markerstyle="diamond" color="##0a7caa" > 
            <cfchartdata item="Day 1" value="39.2"/> 
            <cfchartdata item="Day 2" value="35.2"/> 
        </cfchartseries> 
    </cfchart> 


    <cfchart showLegend="no" title="Two-series Line chart" type="area" plotarea = "#{"margin"="dynamic"}#"> 
        <cfchartseries serieslabel="Acme Inc." markerstyle="circle" color="##0aaa8f"> 
            <cfchartdata item="Day 1" value="19.2"/> 
            <cfchartdata item="Day 2" value="15.2"/> 
        </cfchartseries> 

        <cfchartseries serieslabel="CFX Tech" markerstyle="diamond" color="##0a7caa" > 
            <cfchartdata item="Day 1" value="39.2"/> 
            <cfchartdata item="Day 2" value="35.2"/> 
        </cfchartseries> 

    </cfchart> 

 <cfscript> 
    border={"color":"red"} 
  </cfscript> 

    <cfchart showLegend="no" title="Pie chart"  type="pie" plotarea = "#{"margin"="dynamic"}#" showborder="yes" border="#border#"> 
        <cfchartseries serieslabel="Acme Inc." markerstyle="circle" color="##0aaa8f"> 
            <cfchartdata item="Day 1" value="19.2"/> 
            <cfchartdata item="Day 2" value="15.2"/> 
        </cfchartseries> 

        <cfchartseries serieslabel="CFX Tech" markerstyle="diamond" color="##0a7caa" > 
            <cfchartdata item="Day 1" value="39.2"/> 
            <cfchartdata item="Day 2" value="35.2"/> 
        </cfchartseries> 
    </cfchart> 

    <cfchart showLegend="no" type="line" title="Two-series Line chart"> 
        <cfchartseries serieslabel="Acme Inc." markerstyle="circle" color="##0aaa8f"> 
            <cfchartdata item="Day 1" value="19.2"/> 
            <cfchartdata item="Day 2" value="15.2"/> 
        </cfchartseries> 

        <cfchartseries serieslabel="CFX Tech" markerstyle="diamond" color="##0a7caa" > 
            <cfchartdata item="Day 1" value="39.2"/> 
            <cfchartdata item="Day 2" value="35.2"/> 
        </cfchartseries> 
    </cfchart> 

    <cfchart showLegend="no" type="ring" title="Ring chart"> 
        <cfchartseries serieslabel="Acme Inc." markerstyle="circle" color="##0aaa8f"> 
            <cfchartdata item="Day 1" value="19.2"/> 
            <cfchartdata item="Day 2" value="15.2"/> 
        </cfchartseries> 

        <cfchartseries serieslabel="CFX Tech" markerstyle="diamond" color="##0a7caa" > 
            <cfchartdata item="Day 1" value="39.2"/> 
            <cfchartdata item="Day 2" value="35.2"/> 
        </cfchartseries> 

    </cfchart> 

</cfchartset>
Output
Figure: Output from cfchartset tag
Output from cfchartset tag
Example 2- 2 rows and 3 columns
This following script creates a 2x3 layout of five charts using <cfchartset>. Each chart visualizes data for two companies, Acme Inc. and CFX Tech, with values for Day 1 and Day 2.
code
<cfchartset format="html" layout="2x3" height="1000" width="1000" name="first viz">     
    <cfchart type="bar" title="Two-series bar chart" plotarea = "#{"margin"="dynamic"}#" showlegend="yes"> 
        <cfchartseries serieslabel="Acme Inc." markerstyle="circle" color="##0aaa8f"> 
            <cfchartdata item="Day 1" value="19.2"/> 
            <cfchartdata item="Day 2" value="15.2"/> 
        </cfchartseries> 
        <cfchartseries serieslabel="CFX Tech" markerstyle="diamond" color="##0a7caa" > 
            <cfchartdata item="Day 1" value="39.2"/> 
            <cfchartdata item="Day 2" value="35.2"/> 
        </cfchartseries> 
    </cfchart> 


    <cfchart showLegend="no" title="Two-series Line chart" type="area" plotarea = "#{"margin"="dynamic"}#"> 
        <cfchartseries serieslabel="Acme Inc." markerstyle="circle" color="##0aaa8f"> 
            <cfchartdata item="Day 1" value="19.2"/> 
            <cfchartdata item="Day 2" value="15.2"/> 
        </cfchartseries> 

        <cfchartseries serieslabel="CFX Tech" markerstyle="diamond" color="##0a7caa" > 
            <cfchartdata item="Day 1" value="39.2"/> 
            <cfchartdata item="Day 2" value="35.2"/> 
        </cfchartseries> 

    </cfchart> 

 <cfscript> 
    border={"color":"red"} 
  </cfscript> 

    <cfchart showLegend="no" title="Pie chart"  type="pie" plotarea = "#{"margin"="dynamic"}#" showborder="yes" border="#border#"> 
        <cfchartseries serieslabel="Acme Inc." markerstyle="circle" color="##0aaa8f"> 
            <cfchartdata item="Day 1" value="19.2"/> 
            <cfchartdata item="Day 2" value="15.2"/> 
        </cfchartseries> 

        <cfchartseries serieslabel="CFX Tech" markerstyle="diamond" color="##0a7caa" > 
            <cfchartdata item="Day 1" value="39.2"/> 
            <cfchartdata item="Day 2" value="35.2"/> 
        </cfchartseries> 
    </cfchart> 

    <cfchart showLegend="no" type="line" title="Two-series Line chart"> 
        <cfchartseries serieslabel="Acme Inc." markerstyle="circle" color="##0aaa8f"> 
            <cfchartdata item="Day 1" value="19.2"/> 
            <cfchartdata item="Day 2" value="15.2"/> 
        </cfchartseries> 

        <cfchartseries serieslabel="CFX Tech" markerstyle="diamond" color="##0a7caa" > 
            <cfchartdata item="Day 1" value="39.2"/> 
            <cfchartdata item="Day 2" value="35.2"/> 
        </cfchartseries> 
    </cfchart> 

    <cfchart showLegend="no" type="ring" title="Ring chart"> 
        <cfchartseries serieslabel="Acme Inc." markerstyle="circle" color="##0aaa8f"> 
            <cfchartdata item="Day 1" value="19.2"/> 
            <cfchartdata item="Day 2" value="15.2"/> 
        </cfchartseries> 

        <cfchartseries serieslabel="CFX Tech" markerstyle="diamond" color="##0a7caa" > 
            <cfchartdata item="Day 1" value="39.2"/> 
            <cfchartdata item="Day 2" value="35.2"/> 
        </cfchartseries> 

    </cfchart> 

</cfchartset>
Example 3 - using a horizontal layout
This following script code creates a side-by-side pie and bar chart visualization using <cfchartset> with a horizontal layout. The <cfscript> block defines styling attributes: a background gradient (##10ba9d to white), a pie slice size (56%), and polar chart scaling properties (refAngle and aperture set to 180).
code
<cfscript>
    background = {"color" = "##10ba9d", "color-2" = "white"};
    plot = {"slice" = "56%"}
    scaleR = {"refAngle" = 180, "aperture" = 180}
</cfscript>

<cfchartset format="html" layout="horizontal" height="400" width="1800">
    <cfchart format = "html" type = "pie" background="#background#" markersize="5">
        <cfchartseries label="Temperatures(°C)- Monthly" seriescolor="white">
                <cfchartdata item="Jan" value="5">
                <cfchartdata item="Feb" value="70">
                <cfchartdata item="Mar" value="10">
                <cfchartdata item="Apr" value="40">
                <cfchartdata item="May" value="18">
                <cfchartdata item="Jun" value="22">
        </cfchartseries>
    </cfchart>

    <cfchart format = "html" type = "bar" background="#background#">
    <cfchartseries  label="Temperature(°C) - Monthly" seriescolor="##3a5551">
            <cfchartdata item="Jan" value="5">
            <cfchartdata item="Feb" value="7">
            <cfchartdata item="Mar" value="10">
            <cfchartdata item="Apr" value="14">
            <cfchartdata item="May" value="18">
            <cfchartdata item="Jun" value="22">
        </cfchartseries>
    </cfchart>
</cfchartset>
Output
Example 4 - using a vertical layout
This following script code creates a side-by-side pie and bar chart visualization using <cfchartset> with a vertical layout. The <cfscript> block defines styling attributes: a background gradient (##10ba9d to white), a pie slice size (56%), and polar chart scaling properties (refAngle and aperture set to 180).
code
<cfscript>
    background = {"color" = "##10ba9d", "color-2" = "white"};
    plot = {"slice" = "56%"}
    scaleR = {"refAngle" = 180, "aperture" = 180}
</cfscript>

<cfchartset format="html" layout="vertical" height="800" width="1000">
    <cfchart format = "html" type = "pie" background="#background#" markersize="5">
        <cfchartseries label="Temperatures(°C)- Monthly" seriescolor="white">
                <cfchartdata item="Jan" value="5">
                <cfchartdata item="Feb" value="70">
                <cfchartdata item="Mar" value="10">
                <cfchartdata item="Apr" value="40">
                <cfchartdata item="May" value="18">
                <cfchartdata item="Jun" value="22">
        </cfchartseries>
    </cfchart>

    <cfchart format = "html" type = "bar" background="#background#">
    <cfchartseries  label="Temperature(°C) - Monthly" seriescolor="##3a5551">
            <cfchartdata item="Jan" value="5">
            <cfchartdata item="Feb" value="7">
            <cfchartdata item="Mar" value="10">
            <cfchartdata item="Apr" value="14">
            <cfchartdata item="May" value="18">
            <cfchartdata item="Jun" value="22">
        </cfchartseries>
    </cfchart>
</cfchartset>
Output

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page