Copy link to clipboard
Copied
I am trying to get animation to work in CF11, CFChart. I can't it to work any input would be greatly appreciated.
My code is below. Arrows works, but plot does not.
<cfscript>
arrows=[{"backgroundColor":"red","label":{"text":"Data for 2017","bold":true,"backgroundColor":"white"},
"size":6,"FROM":{"x":200,"y":100},"to":{"x":400,"y":200}}];
plot = {
"animation": {
"effect": "ANIMATION_FADE_IN",
"speed": "2000"
}
}
</cfscript>
<CFSET FormsMarkedCompleted = 34>
<CFSET FormsMarkedNotCompleted = 21>
<CFSET TotalFormsEntered 40>
<cfoutput>
<cfchart
showygridlines="true"
gridlines="20"
type="bar"
<!--- arrows="#arrows#" --->
plot="#plot#"
chartHeight="320"
chartWidth="800"
title="Number of competed forms and expected forms" >
<cfchartseries >
<cfchartdata item="Forms Marked Completed (#FormsMarkedCompleted#)" value="#FormsMarkedCompleted#" >
<cfchartdata item="Forms Marked Not Completed (#FormsMarkedNotCompleted#) " value="#FormsMarkedNotCompleted#">
<cfchartdata item="Total Forms Entered (#TotalFormsEntered#)" value="#TotalFormsEntered#">
</cfchartseries>
</cfchart>
</cfoutput>
Copy link to clipboard
Copied
Moving thread to the ColdFusion forum from Using the Community
Copy link to clipboard
Copied
I found an error in your code:
<CFSET TotalFormsEntered 40>
After I corrected it to
<CFSET TotalFormsEntered = 40>
the code worked as expected.
However, I am on CF2021 Update 2.
Copy link to clipboard
Copied
Oh, another thing: delete the cfoutput tags. Not only are they unnecessary, they could cause problems with certain tags.
Copy link to clipboard
Copied
I added the = and removed the cfoutput, but unfortunaly the animation still does not work for me in CF11.
Copy link to clipboard
Copied
Open the CFM page in the browser.
Press F12 to open Developer Tools.
Press F5 to refresh the page.
Do you see any errors in Developer Tools?
Copy link to clipboard
Copied
I made some corrections (mainly to arrows), then tested the following code on https://trycf.com
<cftry>
<cfscript>
arrows=[{
"backgroundColor": "red",
"label": {
"text": "Data for 2017",
"bold": "true",
"backgroundColor": "white"
},
"size": "6",
"FROM": {
"x": "200",
"y": "100"
},
"to": {
"x": "400",
"y": "200"
}
}];
plot={
"animation": {
"effect": "ANIMATION_FADE_IN",
"speed": "2000"
}
};
</cfscript>
<CFSET FormsMarkedCompleted = 34>
<CFSET FormsMarkedNotCompleted = 21>
<CFSET TotalFormsEntered = 40>
<cfchart
showygridlines="true"
gridlines="20"
type="bar"
arrows="#arrows#"
plot="#plot#"
chartHeight="320"
chartWidth="800"
title="Number of competed forms and expected forms" >
<cfchartseries >
<cfchartdata item="Forms Marked Completed (#FormsMarkedCompleted#)" value="#FormsMarkedCompleted#" >
<cfchartdata item="Forms Marked Not Completed (#FormsMarkedNotCompleted#) " value="#FormsMarkedNotCompleted#">
<cfchartdata item="Total Forms Entered (#TotalFormsEntered#)" value="#TotalFormsEntered#">
</cfchartseries>
</cfchart>
<cfcatch type="any">
<cfdump var="#cfcatch#">
</cfcatch>
</cftry>
It worked for CF2016 and CF2016 but, unfortunately, not for CF 11. It didn't give an error either.