dreamRs / billboarder

:bar_chart: R Htmlwidget for billboard.js
https://dreamrs.github.io/billboarder/
Other
174 stars 21 forks source link

increase label size #8

Open karthees89 opened 5 years ago

karthees89 commented 5 years ago

`` 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 commented 5 years ago

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 : 

```r

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

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

Victor