The following figure shows these options for combining two bar charts:
clustered
You can also combine chart types. The following is a combination bar and line chart:
The only chart type that you cannot mix with others is the pie chart. If you define one of the data
series to use a pie chart, no other chart will appear.
The following example creates the previous figure showing a bar chart with a line chart added to
it. In this example, you chart the salary of permanent employees (bar) against contract employees
(line).
Note: The layering of multiple series depends on the order that you specify the cfchartseries tags.
For example, if a bar chart is specified first and a line chart second, the bar chart appears in front of
the line chart in the final chart.
To create a combination bar and a line chart:
Open chartdata.cfm in your editor.
1
Edit the
2
cfchart
<cfchart
backgroundColor="white"
xAxisTitle="Department"
yAxisTitle="Salary Average"
font="Arial"
gridlines=6
showXGridlines="yes"
showYGridlines="yes"
showborder="yes"
>
<cfchartseries
type="line"
seriesColor="blue"
paintStyle="plain"
seriesLabel="Contract Salaries"
>
<cfchartdata item="HR" value=70000>
<cfchartdata item="Marketing" value=95000>
<cfchartdata item="Sales" value=80000>
<cfchartdata item="Training" value=93000>
</cfchartseries>
626
Chapter 28: Charting and Graphing Data
stacked
tag so that it appears as follows:
percent
Need help?
Do you have a question about the COLDFUSION MX 61-DEVELOPING COLDFUSION MX and is the answer not in the manual?