Browser compatibility issues due to JavaScript Chinese annotations in Amcharts charts

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.