Home Forums Chart Support Format Numbers 1,000,000 to 1M or 1,000 to 1K

Format Numbers 1,000,000 to 1M or 1,000 to 1K

Viewing 4 posts - 1 through 4 (of 4 total)
  • #27462

    Hi Canvasjs. I’m new to this charting library. Recently I’ve read in documentation of valueFormatString, and I’ve read in the comments that it is not yet supported by this library. I’m asking if there is any suitable solution for what I’m trying to achieve?

    1,000,000 >>>> 1M
    1,000 >>>>>>>> 1K

    Thank you.

    #27475

    @jfranco30,

    You can achieve this with the help of labelFormatter. Please take a look at this gallery page for the live working example.


    Vishwas R
    Team CanvasJS

    #27479

    Thanks for the reply. I’ve tried this and works fine, however this is only possible if the whole values are positive. How about if I have a negative values because in my case there is a negative values. Does canvasjs support this feature?

    Thank you again :)

    #27504

    @jfranco30,

    Taking the absolute value within labelFormatter should work fine in this case. Please take a look at this JSFiddle.

    If you are still facing issue, kindly create JSFiddle with sample data and share it with us so that we can look into the code, understand the scenario better and help you out.


    Vishwas R
    Team CanvasJS

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.