Closed ahbon123 closed 1 year ago
Howdy @ahbon123 ! Please see the documentation for that function and the palette
argument:
palette
A character string with 5 elements indicating the colors of various components. Order matters, and palette = sparkline color, final value color, range color low, range color high, and 'type' color (eg shading or reference lines).
The first element of the palette
argument is the sparkline color.
For your example snippet:
library(gt)
mtcars %>%
dplyr::group_by(cyl) %>%
# must end up with list of data for each row in the input dataframe
dplyr::summarize(mpg_data = list(mpg), .groups = "drop") %>%
gt() %>%
gt_plt_sparkline(mpg_data, palette = c("grey", "black", "red", "blue", "lightgrey"))
Hello Tom,
On gtExtras 0.3.8, we can set the color of sparkline lines and extrema by parameters
line_color = 'grey', range_colors = c('blue', 'red')
(refer to gt_sparkline())When gtExtras is upgraded to version 0.4.3, we need to execute the following code to plot sparkline (refer to gt_plt_sparkline()):
Out:
I don't see parameters like
line_color
andrange_colors
in new version of gtExtras, does that mean we won't be able to manually modify the color of lines and extremes or there are other ways to doing so? Thanks.