Home forums Using CanvasJS Formatting Negative Currency Y Values

This topic contains 2 replies, has 2 voices, and was last updated by  antdow 9 months, 3 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #9899

    antdow
    Member

    Please can you let me know how I would go about showing a Y Value (e.g. on a column chart) with a slightly different format, specifically currency.

    I am using yValueFormat “£#,###,###” to correctly show my values on the charts (e.g. £212,717) however when the result is negative, it is showing is as £-212,717. How can I change this so that the minus sign precedes the currency (i.e. -£212,717)?

    I have worked out how to do this (using labelFormatter) for the Y: axis but not for the actual values on the bars themselves.

    Thank you very much for your help,

    Tony

    #9902

    Sanjoy
    Moderator

    In this case you can use formatNumber along with labelFormatter or indexLabelFormatter function as shown in this JSFiddle.

    #9903

    antdow
    Member

    Thank you Sanjoy, that works perfectly. Great solution!

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

You must be logged in to reply to this topic.