chart_labels_text: Modify labels font settings

View source: R/chart_data_styles.R

chart_labels_textR Documentation

Modify labels font settings

Description

Specify mappings from levels in the data to displayed text font settings.

Usage

chart_labels_text(x, values)

Arguments

x

an ms_chart object.

values

a named list of fp_text() objects to map data labels to. It is a named list, the values will be matched based on the names. If it contains only one fp_text() object, it will be associated to all existing series.

See Also

Other Series customization functions: chart_data_fill(), chart_data_line_style(), chart_data_line_width(), chart_data_size(), chart_data_smooth(), chart_data_stroke(), chart_data_symbol()

Examples

library(officer)

fp_text_settings <- list(
  serie1 = fp_text(font.size = 7, color = "red"),
  serie2 = fp_text(font.size = 0, color = "purple"),
  serie3 = fp_text(font.size = 19, color = "wheat")
)

barchart <- ms_barchart(
  data = browser_data,
  x = "browser", y = "value", group = "serie")
barchart <- chart_data_labels(barchart, show_val = TRUE)
barchart <- chart_labels_text( barchart,
  values = fp_text_settings )

ardata-fr/mschart documentation built on Dec. 7, 2022, 9:44 a.m.