Highcharts Chart: How to configure whether the axis data is too large to convert units (k,m,g,t,p,e) to replace

Source: Internet
Author: User

There have been a number of highcharts chart users asking questions about the axis scale value data that is automatically added to k,m,g,t,p,e some unit characters. This kind of question starts to look also thinks is the axis scale formatted the formatter method question, after the experiment is not feasible. Helplessly looked at Highcharts.js source code, through the ctrl+f find "K", see these configuration information is found by the attribute:numericsymbols control. The source code is written like this:

View Source print? 1., Decimalpoint: ".", Numericsymbols: "K,m,g,t,p,e". Split (","),


Find Numericsymbols in the Api.highcharts.comAPI document to be aware of the following:

View Source print? 1. numericsymbols:array<string>since 2.3.0 2. Metric prefixes used to shorten high numbers in axis labels. Replacing any of the positions with NULL causes the full number to be written. Setting numericsymbols to null disables shortening altogether. Defaults to ["K", "M", "G", "T", "P", "E"].


This paragraph of the English description can be broadly seen to mean:


View Source print? 1. Used to configure the suffix to shorten the large data placeholder for the on-axis scale, so that when set to null, the suffix is not replaced. By default is the configuration array ["K", "M", "G", "T", "P", "E"]


In this way we want to make the scale of large data conversion unit is very good solution.


1. Configure the value of the Numericsymbols attribute in Lang

The global variables are first set by Highcharts.setoptions () before new Highcharts.chart (), and the sample code is as follows:


View Source print? 1. Highcharts.setoptions ({2. lang: {3. numericsymbols:null//No Conversion Unit 4.} 5.});


The complete sample code looks like this:


View Source print? $ (function () {02. Highcharts.setoptions ({. lang: {numericsymbols:null. 05.} 06.}); 07.08. $ (' #container '). Highcharts ({). chart: {Ten.}, title:{. Text: "How to make the coordinate scale big data not automatically append suffix K, m and other symbol examples". Xaxis: {15. Categories: [' Jan ', ' Feb ', ' Mar ', ' Apr ', ' may ', ' June ', ' Jul ', ' April ', ' Sep ', ' Oct ', ' Nov ', ' Dec '] 16. }, 17. YAxis: {. Type: ' Logarithmic ' 19.}, 20. credits:{text: "Www.stepday.com",. href: "http://www.stepday.com", style:{. Color: "Red" 25.} 26.}, 27. Series: [{. Data: [0.029, 71.5, 1.06, 1292, 14400, 1.760, 135, 1480, 0.0216, 0.194, 9.56, 54.4] 29.}] 30.}); 31.});


View effect Address : http://fiddle.jshell.net/tdB5j/1/show/reprint:http://www.stepday.com/topic/?819&quot;

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.