How to display legend on a Chart in ColdFusion

cfchart - legend in chart

cfchartLegend.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfchart tag: how to use legend in chart in coldfusion</title>
</head>

<body>
<h2 style="color:DarkOliveGreen; font-style:italic">cfchart example: how to use legend</h2>
<hr width="700" align="left" color="LightPink" />
<br />

<cfquery name="qEmployee" datasource="cfdocexamples" maxrows="10">
 SELECT FirstName, LastName, Salary FROM EMPLOYEE
</cfquery>

<cfchart 
    format="png"
    xaxistitle="First Name"
    yaxistitle="Salary"
    chartheight="400"
    chartwidth="700"
    showlegend="yes"
    backgroundcolor="2F4F4F"
    foregroundcolor="FFFAFA"
    fontbold="yes"
    show3d="yes"
    databackgroundcolor="8FBC8F"
    font="Verdana"
    fontsize="13"
    showxgridlines="no"
    showygridlines="yes"
    >
    <cfchartseries 
     query="qEmployee" 
        type="pie" 
        itemcolumn="FirstName" 
        valuecolumn="Salary"
        >
    </cfchartseries>
</cfchart>
</body>
</html>





More coldfusion examples