Home forums Using CanvasJS Formatting Negative Currency Y Values

This topic contains 2 replies, has 2 voices, and was last updated by  antdow 8 months, 1 week ago.

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


    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,




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



    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.