tickformatter_numeral {rbokeh} | R Documentation |
Tick formatter based on a human-readable format string.
tickformatter_numeral(format = "0,0", rounding = "round", language = "en", clear = FALSE)
format |
The number format, as defined in the tables described in the details. For the complete specification, see http://numbrojs.com/format.html. |
rounding |
Rounding functions (round, floor, ceil) and their synonyms (nearest, rounddown, roundup). |
language |
The language to use for formatting language-specific features (e.g. thousands separator). |
clear |
A logical indicating whether all non-specified parameters should be cleared out of any exising specification in the figure. This can be useful when modifying a previously-defined figure. |
Possible values for format
are defined in the following tables:
NUMBERS
Number | Format | String |
10000 | '0,0.0000' | 10,000.0000 |
10000.23 | '0,0' | 10,000 |
10000.23 | '+0,0' | +10,000 |
-10000 | '0,0.0' | -10,000.0 |
10000.1234 | '0.000' | 10000.123 |
10000.1234 | '0[.]00000' | 10000.12340 |
-10000 | '(0,0.0000)' | (10,000.0000) |
-0.23 | '.00' | -.23 |
-0.23 | '(.00)' | (.23) |
0.23 | '0.00000' | 0.23000 |
0.23 | '0.0[0000]' | 0.23 |
1230974 | '0.0a' | 1.2m |
1460 | '0 a' | 1 k |
-104000 | '0a' | -104k |
1 | '0o' | 1st |
52 | '0o' | 52nd |
23 | '0o' | 23rd |
100 | '0o' | 100th
|
CURRENCY
Number | Format | String |
1000.234 | '$0,0.00' | $1,000.23 |
1000.2 | '0,0[.]00 $' | 1,000.20 $ |
1001 | '$ 0,0[.]00' | $ 1,001 |
-1000.234 | '($0,0)' | ($1,000) |
-1000.234 | '$0.00' | -$1000.23 |
1230974 | '($ 0.00 a)' | $ 1.23 m
|
BYTES
Number | Format | String |
100 | '0b' | 100B |
2048 | '0 b' | 2 KB |
7884486213 | '0.0b' | 7.3GB |
3467479682787 | '0.000 b' | 3.154 TB
|
PERCENTAGES
Number | Format | String |
1 | '0%' | 100% |
0.974878234 | '0.000%' | 97.488% |
-0.43 | '0 %' | -43 % |
0.43 | '(0.000 %)' | 43.000 %
|
TIME
Number | Format | String |
25 | '00:00:00' | 0:00:25 |
238 | '00:00:00' | 0:03:58 |
63846 | '00:00:00' | 17:44:06
|
A specification that is used as the tickformatter
argument for x_axis
or y_axis
.
figure() %>% ly_points(1:10) %>% x_axis(tickformatter = tickformatter_numeral(format = "0o")) figure() %>% ly_points((1:10) ^ 4, 1:10) %>% x_axis(tickformatter = tickformatter_numeral(format = "($0,0)", language = "it")) figure() %>% ly_points((1:11) ^ 6, 1:11) %>% x_axis(tickformatter = tickformatter_numeral(format = "0.0b"))