Home › forums › Using CanvasJS › Formatting Negative Currency Y Values
Tagged: negative format currency
This topic contains 2 replies, has 2 voices, and was last updated by antdow 3 years, 6 months ago.
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!
You must be logged in to reply to this topic.