set_formatter_progress | R Documentation |
Set progress formatter
set_formatter_progress(
widget,
column,
min = NA,
max = NA,
color = c("yellow", "orange", "red"),
legend = NA,
legend_color = "#000000",
legend_align = c("center", "left", "right", "justify"),
hoz_align = "left"
)
widget |
A |
column |
The name of the column the formatter is applied to. |
min |
(numeric): The minimum value for progress bar.
If set to |
max |
(numeric): The maximum value for progress bar.
If set to |
color |
(character): Either a single color or a vector of colors |
legend |
(character, |
legend_color |
(character): The text color of the legend. |
legend_align |
(character): The text alignment of the legend. |
hoz_align |
(character): The horizontal alignment of the column. |
The updated tabulator()
HTML widget
data <- data.frame(
id = 1:6,
value = c(10, 0, 100, 20, 40, 60),
value2 = c(10, 0, 100, 20, 40, 60),
value3 = c(10, 0, 100, 20, 40, 60)
)
js_func <- htmlwidgets::JS("(cellValue) => `${cellValue}%`")
tabulator(data) |>
set_formatter_progress("value") |>
set_formatter_progress("value2", legend = TRUE, legend_align = "left") |>
set_formatter_progress("value3", legend = js_func, legend_align = "right")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.