Recently made a chart with amcharts. Everything is smooth, and then the presentation of the time off the chain, usually developed when the use of Firefox and Google, plus this chart framework is known as compatibility is very good, also did not test on IE, the demonstration of the machine happened to use the IE11, The directory name for the x-axis of an ordinary columnar chart is shown as undefined. It's all right to switch to Google Chrome.
Obviously there is a compatibility problem, but this is very strange ah, with IE open amcharts of the official website of the demo, found that the display is normal, but the program is not normal, and immediately the latest version of the official network to replace the version of the machine, and then run still show abnormal. Replace all the examples on the Internet, It is normal to open the display with IE. that's weird. Then start the line by comparison code, the normal demo key code point is:
"Categoryfield": "Reqname", "Categoryaxis": { "gridposition": "Start", " Gridalpha ": 0, " tickposition ":" Start ", " ticklength ": Labelfunction ":function(value, FormattedValue, Valueaxis) { return Value.substring (0,5); } }
The locally problematic code is:
// "Categoryaxis" : { "gridposition": "Start" , "Grida Lpha ": 0 "tickposition": "Start" "Ticklength": 20" labelfunction ": Span style= "color: #0000ff;" >function return value.substring (0,5); } }
In addition to a line of Chinese comments there is no difference, and then try to remove the Chinese comments of the problematic code, run the display is normal, and then change the Chinese note to the//x axis is also displayed normal.
This can only come to the conclusion that some Chinese annotations may have some problems when they are parsed by the browser.
Browser compatibility issues due to JavaScript Chinese annotations in Amcharts charts