You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prework
Searched for duplicates among the existing issues (both open and closed).
Proposal:
I would like to request the ability to specify a custom font family within the gt_plt_bar() function in the gtExtras package. Currently, the function allows for customisation of font_size and font_style, but it does not provide an option to set the font_family.
Use Case:
In my work, I frequently create tables using the gt package combined with the gtExtras::gt_plt_bar() function to display bar charts within table cells. However, I need to ensure consistency in font usage across my tables to adhere to organizational branding guidelines, which specify a particular font family. While I can change the font family for text in gt tables using tab_style(), I cannot apply this customization to the bar charts created by gt_plt_bar().
Minimal Example:
Here is an example of the current usage where I attempt to change the font family, but it doesn't take effect:
library(gt)
library(gtExtras)
# Sample datadata<-data.frame(
Category= c("A", "B", "C"),
Value= c(20, 50, 80)
)
# Desired font family (e.g., "Arial Narrow")narrow_font_family<-"Arial Narrow"# Create a gt table and add barsgt_table<-data %>%
gt() %>%
gt_plt_bar(column=Value, fill="lightblue", font_size=12) %>%
tab_style(
style= cell_text(font=narrow_font_family),
locations= cells_body(columns="Value")
)
# The font family does not change for the text within the bars
Desired Outcome:
The ability to set the font_family directly within the gt_plt_bar() function or have the function respect the global font family set for the gt table.
For example:
gt_plt_bar(
column=Value,
color="lightblue",
font_family="Arial Narrow", # New featurefont_size=12
)
This would allow for greater customization and consistency in tables created with the gtExtras package.
Conclusion:
Adding support for a custom font_family in gt_plt_bar() would greatly enhance the flexibility of the function, enabling users to create tables that are fully aligned with their desired styling and branding guidelines.
Thank you for considering this feature request!
Stephanie
The text was updated successfully, but these errors were encountered:
Prework
Searched for duplicates among the existing issues (both open and closed).
Proposal:
I would like to request the ability to specify a custom font family within the
gt_plt_bar()
function in thegtExtras
package. Currently, the function allows for customisation offont_size
andfont_style
, but it does not provide an option to set thefont_family
.Use Case:
In my work, I frequently create tables using the
gt
package combined with thegtExtras::gt_plt_bar()
function to display bar charts within table cells. However, I need to ensure consistency in font usage across my tables to adhere to organizational branding guidelines, which specify a particular font family. While I can change the font family for text ingt
tables usingtab_style()
, I cannot apply this customization to the bar charts created bygt_plt_bar()
.Minimal Example:
Here is an example of the current usage where I attempt to change the font family, but it doesn't take effect:
Desired Outcome:
The ability to set the
font_family
directly within thegt_plt_bar()
function or have the function respect the global font family set for thegt
table.For example:
This would allow for greater customization and consistency in tables created with the
gtExtras
package.Conclusion:
Adding support for a custom
font_family
ingt_plt_bar()
would greatly enhance the flexibility of the function, enabling users to create tables that are fully aligned with their desired styling and branding guidelines.Thank you for considering this feature request!
Stephanie
The text was updated successfully, but these errors were encountered: