Reputation: 500
I am facing a problem with a bar chart using ColdFusion.
If there is only one <cfchartseries>
tag, then the SeriesLabel attribute is not displaying. Instead of that, the items of the cfchartdata are displaying.
If there are more then one <cfchartseries>
, then the SeriesLabel specified is displaying properly.
Please look at the code and its corresponding bar chart attached .
BarChart1:
<cfchart format="jpg" xaxistitle="Month" yaxistitle="MonthlyTotal"
seriesPlacement="stacked"
showLegend="yes"
showMarkers="no"
chartHeight="300" chartWidth="400" >
<labelStyle orientation="Horizontal"/>
<cfchartseries type="bar" seriesLabel="T" >
<cfchartdata item="jan2007" value="1">
<cfchartdata item="Feb2007" value="3">
<cfchartdata item="Mar2007" value="2">
<cfchartdata item="Apr2007" value="4">
</cfchartseries>
</cfchart>
BarChart2 :
<cfchart format="jpg" xaxistitle="Month" yaxistitle="MonthlyTotal"
seriesPlacement="stacked"
showLegend="yes"
showMarkers="no"
chartHeight="300" chartWidth="400" >
<labelStyle orientation="Horizontal"/>
<cfchartseries type="bar" seriesLabel="T" >
<cfchartdata item="jan2007" value="1">
<cfchartdata item="Feb2007" value="3">
<cfchartdata item="Mar2007" value="2">
<cfchartdata item="Apr2007" value="4">
</cfchartseries>
<cfchartseries type="bar" seriesLabel="D">
<cfchartdata item="jan2007" value="1">
<cfchartdata item="Feb2007" value="3">
<cfchartdata item="Mar2007" value="2">
<cfchartdata item="Apr2007" value="4">
</cfchartseries>
</cfchart>
The Barchart1 needs to show T
as the SeriesLabel. Instead of that, its showing the "nonths", which are the X-axis variables. The Barchart2 is showing properly as per the code.
I tried my best to solve it by my self but I am unable to find the problem. Requesting people give me your ideas. I am waiting for you suggestions.
Thank You
Upvotes: 2
Views: 507
Reputation: 10857
If your intent is to put Texas on top, you could use chartTitle instead. I'd also strongly urge you to consider using the newer chart engine if you are CF10 Enterprise, or another chart engine altogether.
Upvotes: 0