tracker issue : CF-3860648

select a category, or use search below
(searches all categories and all time range)

Unable to flush header/content prior to a graph

| View in Tracker

Status/Resolution/Reason: Closed/Won't Fix/Workaround

Reporter/Name(from Bugbase): Eric Tabet / Eric Tabet (etabet)

Created: 12/02/2014

Components: Charting/Graphing

Versions: 11.0

Failure Type: Non Functioning

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Critical / All users will encounter

Locale/System: English / Win 2012 Server x64

Vote Count: 1

Problem Description:
CFCHART is now expecting to be in a page that hasn't yet been flushed to the user.
This is a regression from previous versions where this was possible.

Steps to Reproduce:
Use the following code:
<cfchart format="png" height="400" width="600">
   <cfchartseries type="bar">
       <cfchartdata item="2005" value="1000"/>
       <cfchartdata item="2006" value="3000"/>
       <cfchartdata item="2007" value="1000"/>
       <cfchartdata item="2008" value="4000"/>
       <cfchartdata item="2009" value="2000"/>

Actual Result:
Error message:
Unable to add text to HTML HEAD tag.
ColdFusion was unable to add the text you specified to the output stream
This is probably because you have already used a CFFLUSH tag in your template or buffered output is turned off

Expected Result:
the chart should still display

Any Workarounds:
On an application where header/content is flushed prior to page execution, there is no workaround.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3860648

External Customer Info:
External Company:  
External Customer Name: etabet
External Customer Email:  
External Test Config: My Hardware and Environment details:

Windows 2012 x64



Can you try using cfajaximport?
Comment by Himavanth R.
9827 | December 04, 2014 07:24:40 AM GMT
What do you mean "try using cfajaximport"? Which library would you like us to try using? All we want is to flush a header/navigation and some content and then show a graph/chart. This is not possible anymore (regardless of Flash/HTML/PNG/JPG).
Comment by External U.
9828 | December 04, 2014 07:30:53 AM GMT
+1 - verified the code displays a chart in CF10u14 but throws an exception in CF11u3
Vote by External U.
9831 | January 04, 2015 04:52:12 PM GMT
The new charting engine needs some javascript files to be added in the header. CFFlush flushes the header the first time it is used and any attempt to use any ajax features after cfflush will fail. (as documented here ). So any attempt to render a chart after cfflush fails. The workaround for now seems to be adding <cfajaximport tags="cfchart"> at the beginning of the page.
Comment by Himavanth R.
9829 | January 07, 2015 01:15:55 AM GMT
Thanks a Lot, i have this problem and was resolved with this tag
Comment by External U.
9830 | June 16, 2016 11:43:20 AM GMT