Copy link to clipboard
Copied
The pie chart below was created in ColdFusion v11
with the following javascript:
{
"graphset":[
{
"border-width":1,
"background-color":"transparent",
"foreground-color":"black",
"plot":{
"value-box":{"color":"black"},
"border-color":"black",
"tooltip-text":"%t\n%v"
},
"plotarea":{
"margin":"dynamic"
},
"legend":{
"border-color":"red",
"layout":"2x",
"x":10,
"y":30,
"shadow":true,
"height":"40px"
}
}
]
}
in v2016 the JS does not work at all and received an error:
SyntaxError: unterminated string literal (zingchart-rhino.min.js#8(eval)#1) The specific sequence of files included or processed is: C:\websites\HazTrak\html\HazPortal.cfm, line: 1
if I take out the javascript the pie chart looks like:
I either need a fixed so that v2016 will work with the same JS or an xml file to do the same as the js did.
Copy link to clipboard
Copied
The problem turned out to be the \n was causing the error. Do not know why the \n (line feed) would cause an error. It should not and did not in prior version. Also noticed that the border is not displaying correctly. Using a width of "1" will only show up on the left side. In order to have the border show up around the entire frame, you need a width of "2", but then the left border is thicker. Again, this worked fine in the previous version. And finally the size of the pie will change size depending on the placement of the titles which did not happen in prior version.
Copy link to clipboard
Copied
The \n line feed (next line / new line) is breaking the string, thus the "unterminated string literal" error message.
Sort of like "Starting a string on one line
and then continuing on the next line".
In JavaScript, it should be "Starting a string on one line" +
"and then continuing on the next line".
I _could_ be wrong, but since the tooltip isn't appearing in an alert(), you might be able to use <br /> instead, to make the tooltip use a new line. I know that in the overLib library you could do that.
Just my two cents.
HTH,
^_^
Copy link to clipboard
Copied
the <br/> did work, but the problem is that you should not have to change code because of a new version. If it worked in one version you should expect it to work in the next.
Copy link to clipboard
Copied
rpschwar27 wrote:
the <br/> did work, but the problem is that you should not have to change code because of a new version. If it worked in one version you should expect it to work in the next.
While generally true, this is due to the fact that ColdFusion merely wraps a 3rd party library (Zing Charts) in <CFCHART> to do the charting - and they upgraded to a newer version of Zing Charts with ColdFusion 2016. That is what "broke" your code. If you were using Zing Charts directly (rather than via the CFChart tag), you might still have had to make code changes.
Copy link to clipboard
Copied
I've also notice that the size of the pie chart will change based on where the titles are placed in the new version. Do you know how to get them to stay the same size. The middle pie is the correct size. How do I make them all the same? And if you notice the borders are thicker on the left because I had to use a border = 2 to get them to even appear on the bottom and right. This was not a problem in v11. Any ideas?
Copy link to clipboard
Copied
Thanks for the workaround. We also ran into this issue (but only for png charts -- format="png" rather than format="html"). The issue occurred in CF 11 Update 12 (but did not occur in CF 11 Update 6).
While removing the "\n" characters prevented the error from occurring, the tooltips no longer show up at all for our png charts Oh well...