if (FALSE) {
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")
}
Run the code above in your browser using DataLab