Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

increase label size #8

Open
karthees89 opened this issue Jun 25, 2019 · 2 comments
Open

increase label size #8

karthees89 opened this issue Jun 25, 2019 · 2 comments

Comments

@karthees89
Copy link

``
image

billboarder() %>%
bb_barchart(
data = explanation_plot_df,
mapping = bbaes(x = feature_desc, y = feature_weight, group = churn_predictor),
rotated = TRUE,
stacked = TRUE
) %>%
bb_colors_manual('Less likely to churn' = 'rgba(63, 182, 24, 0.7)', 'More likely to churn' = 'rgba(255, 0, 57, 0.7)')
})

@pvictor
Copy link
Member

pvictor commented Jun 29, 2019

Hello,
You can increase labels font size with CSS, there's different way to achieve this depending where you want to use your chart.

Standalone chart (in RStudio viewer for example)

Use bb_add_style to use a custom CSS rule :

data("prod_par_filiere")

billboarder(data = prod_par_filiere) %>%
  bb_barchart(
    mapping = bbaes(x = annee, y = prod_hydraulique), 
    rotated = TRUE
  ) %>% 
  bb_add_style(
    ".bb-axis-x" = "font-size: 18px;"
  )

In markdown

Use a CSS chunk in your .Rmd :


```{css}
.bb-axis-x {
  font-size: 18px;
}
```

Siny app

Add a tag style in your UI :

tags$style(".bb-axis-x {font-size: 18px;}")

Note that all that methods above will alter all the charts in your page.

Victor

@luckr26
Copy link

luckr26 commented Nov 22, 2024

coming back to this:
might it be also possible to add further css style like:

  bb_add_style(
    x_grid = list(
      my_class = list(line = "stroke: blue;", text = "font-size: 1rem; font-weight: 600; transform: rotate(-90deg);")))

Iam using:

  bb_grid(
    x = list(lines = custom_lines))

and would like to have the text shown horizontally in the plot.
Thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants