tracker issue : CF-4200015

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

cfchart causes javascript to be prepended to requests, causing invalid json responses

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): Daniel Roberts / Daniel Roberts ()

Created: 10/13/2017

Components: Charting/Graphing

Versions: 2016

Failure Type: Incorrectly functioning

Found In Build/Fixed In Build: 2016.0.05.303689 / 308706

Priority/Frequency: Normal / Some users will encounter

Locale/System: / Win 2012 Server x64

Vote Count: 0

Problem Description:

The cfchart tag in causing javascript to be forced into the output of the page. When the chart is being generated in an ajax request this causes an invalid response as the html/js code is prepended.

Steps to Reproduce:

    <cfdocument format="PDF" filename="test.pdf" overwrite="true">
        <cfchart format="png">
            <cfchartseries type="Bar" label="Numbers">
                <cfchartdata item="First" value="1">
                <cfchartdata item="Second" value="2">
    <cfcontent reset="true" />

Actual Result:

    <script type="text/javascript">/* <![CDATA[ */_cf_loadingtexthtml="<img alt=' ' src=''/>";
    _cf_clientid='1D0DA2C606EC323ABBECA5B29A016CF0';/* ]]> */</script><script type="text/javascript" src="/cf_scripts/scripts/ajax/messages/cfmessage.js"></script>
    <script type="text/javascript" src="/cf_scripts/scripts/ajax/package/cfajax.js"></script>
    <script type="text/javascript" src="/cf_scripts/scripts/chart/cfchart-server.js"></script>


Expected Result:

Any Workarounds:

None that I can find. Tried cfflushing before the cfchart call but that results in an error when the cfchart is hit "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."