Copy link to clipboard
Copied
Previously, if you specified name on cfchart, it would supress display of the chart, save the chart to the variable specified in name, and then allow you to write that variable to a file.
That no longer works. As far as I can the name parameter is now ignored, the chart is displayed regardless, and variable is never set.
What's up with that? Was that parameter removed and not documented, or does it work differently in CF11? How can I get the previous behavior?
Copy link to clipboard
Copied
I ran the code below and the output was suppressed and an image was written to the server. Are you running the latest updater for CF11?
<cfchart format="png" type="HBar" showlegend="false" showborder="false" name="myChart">
<cfchartseries>
<cfchartdata item="Here" value="100">
<cfchartdata item="Goes" value="25">
<cfchartdata item="Else" value="75">
<cfchartdata item="Something" value="40">
</cfchartseries>
</cfchart>
<cfimage action="write" destination="image.png" source="#myChart#" overwrite="yes" >
Copy link to clipboard
Copied
Yes, I'm using the latest update (4).
And I've verified that your code does work on my server. But once I tweak it to the following, it stops working.
<cfchart format="png" type="HBar" showlegend="false" showborder="false" name="myChart">
<cfchartseries>
<cfchartdata item="Here" value="100">
<cfchartdata item="Goes" value="25">
<cfchartdata item="Else" value="75">
<cfchartdata item="Something" value="40">
</cfchartseries>
</cfchart>
<cffile action="write" file="image.png" output="#myChart#">
[Edit: It still doesn't display the chart, as expected, but no file is written.
If I change the format value to flash, then the chart does display, and I get a "Variable MYCHART is undefined" error message.]
Copy link to clipboard
Copied
Did you find a solution? I have the same problem with ColdFusion 2016 update 3.Regardless of creating a jpeg, png or Flash, I get a 500 error saying variable xyz is undefined. Cfchart doesn't seem to be creating a variable with the chart in it. It worked perfectly with CF8 which is what I've upgraded from.
<cfchart name="chart1" ....>
Any reference thereafter to #chart1# throws the undefined variable error. Without any further reference the chart is displayed immediately which is not supposed to happen at all.
I've logged it as bug CF-4198527
Copy link to clipboard
Copied
Since we're talking about cfchart, anyone notice some of the other issues? Did this break in ColdFusion 2016 Update 3, or has it always been broken? I noticed that you can't set a custom Chart Cache Path for caching in the CF admin. I also noticed that even if you set Cache Type to "Memory", that it still appears to write the charts to disk in the default location that I can't change. "...{Instance}\tmpCache\CFFileServlet\_cf_chart". I also noticed that if you keep refreshing the same chart, it doesn't appear to use the cached version, but just keeps generating new ones. I also noticed that the charts end up in the jvm heap (Noticed them with JProfiler), but are never released, causing a memory leak. Something is wrong!
Copy link to clipboard
Copied
Funny that you mentioned a memory leak because my CF2016 instance has just died. The logs mention a java heap memory issue. I'm the only user of a new dev box trying to get charts to work properly, so I've been refreshing my browser all day looking at how charts are rendering. Memory usage crept up until CF stopped responding to requests. With 1 user on the box? Something is wrong and what you said makes sense now. We need to get Adobe involved.
Setup: Windows Server 2012 R2, 4GB RAM. Java heap min is 256Mb, max is 1024Mb. I've just increased the max to 2048 to see if that makes any difference, but that is not a solution to a memory leak.
Copy link to clipboard
Copied
I don't want to hijack Tim357​ thread too much more. I started a new thread about it called CFChart Issues (awaiting moderator approval).