jthomasmock / gtExtras

A Collection of Helper Functions for the gt Package.
https://jthomasmock.github.io/gtExtras/
Other
195 stars 27 forks source link

gt_plt_sparkline label #95

Closed frzambra closed 1 year ago

frzambra commented 1 year ago

Hi all, I'm using gt_plt_sparkline, but I don't know from where the label takes its value or if I can supply a specific one. I suppose the default value is the mean, but:

mtcars |> group_by(cyl) |> summarize(mpd = mean(mpg))
 A tibble: 3 × 2
    cyl   mpd
  <dbl> <dbl>
1     4  26.7
2     6  19.7
3     8  15.1

imagen

I want to use the trend as the label, but I must add another column. It would be good that the user can assign the value for the label from another column.

jthomasmock commented 1 year ago

Howdy - the label is the final value of the data. There isn't an option to change that, just to turn on/off the display of that final value.