add_chart {xlcharts}R Documentation

Add a chart to the sheet

Description

Optionally provide a cell for the top-left anchor

Usage

add_chart(py_obj, chart, anchor = NULL, ...)

Arguments

py_obj

py_obj

chart

chart

anchor

anchor

...

Additional arguments, i.e. kwargs.

Details

https://openpyxl.readthedocs.io/en/stable/api/openpyxl.worksheet.worksheet.html#openpyxl.worksheet.worksheet.Worksheet.add_chart

Value

An openpyxl Python object.

Examples

## Not run: 
wb <- Workbook()
ws <- wb$active
chart <- BarChart(type = "col")
data <- Reference(ws, min_col=2, min_row=1, max_row=7, max_col=3)
cats <- Reference(ws, min_col=1, min_row=2, max_row=7)
chart |>
  add_data(data = data, titles_from_data = TRUE) |>
  set_categories(cats)
ws |> add_chart(chart, "A10")

## End(Not run)


[Package xlcharts version 0.0.2 Index]