Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
100
igDataChart axes formatting
posted

Hi,

I have igDataChart of type "scatterLine". Now I would like to format the X and Y axis i.e if the numbers are too big then would like to show a formatted values. Like if the values ranges as 100,000, 200,000 & 300,000 then would like to show 100k, 200k & 300,000k . 

Is there anyway I can achieve this ?

Parents
  • 30692
    Verified Answer
    Offline posted

    Hi, you can set custom formatting on an axis by setting a function were you control how a double value is rendered to a string, like so:

     

    {            

    name: "yAxis",            

     type: "numericY",            

     minimumValue: 0,            

    formatLabel: function (val) {                 

    var kVal = (val / 1000),                 

    rounded = Math.round(kVal * 100) / 100;                 

    return rounded + "K";            

    }

     

    See this running sample:

    http://jsfiddle.net/gmurray/jnaaM/

Reply Children
No Data