In my bar chart, I have large numbers that are hard to read quickly. I'd like to add commas to make it more readable.
For example: 123456789 --> 123,456,789
How do I do this in Slate?
In my bar chart, I have large numbers that are hard to read quickly. I'd like to add commas to make it more readable.
For example: 123456789 --> 123,456,789
How do I do this in Slate?
Under the "Misc" section of the widget editor, you can configure the format of your chart tooltips. The input accepts handlebars, so you can use the formatNumber helper to template a tooltip based on the bar chart hover value:
From the Slate documentation (Slate > References > Helper reference): formatNumber The formatNumber helper format any given number to a string using the Numeral.js (http://numeraljs.com/) library. Note that the value must be a number and the format must be a string.
Example: Using formatNumber on a number:
For more examples of formating a number, please check the Numeral.js library.