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
Value
An openpyxl Python object.
Examples
library("xlcharts")
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")