Skip to contents

wb_add_sparklines() takes the XML definitions created by create_sparklines() and embeds them into the specified worksheet of a wbWorkbook.

Usage

wb_add_sparklines(wb, sheet = current_sheet(), sparklines)

Arguments

wb

A wbWorkbook object.

sheet

The name or index of the worksheet where the sparklines will be rendered. Defaults to the current sheet.

sparklines

A character vector of sparkline XML strings generated by create_sparklines().

Examples

 sl <- create_sparklines("Sheet 1", dims = "A3:K3", sqref = "L3")
 wb <- wb_workbook()
 wb <- wb_add_worksheet(wb)
 wb <- wb_add_data(wb, x = mtcars)
 wb <- wb_add_sparklines(wb, sparklines = sl)