Learn R Programming

xlcharts (version 0.0.1)

add_data: Add a range of data in a single pass.

Description

The default is to treat each column as a data series.

Usage

add_data(py_obj, data, from_rows = FALSE, titles_from_data = FALSE)

Value

An openpyxl Python object.

Arguments

py_obj

py_obj

data

data

from_rows

from_rows

titles_from_data

titles_from_data

Examples

Run this code
if (FALSE) {
wb <- Workbook()
ws <- active(wb)

chart1 <- BarChart(
  type = "col",
 style = 10,
  title = "Bar Chart",
  shape = 4
) |>
  y_axis(title = "Test number") |>
  x_axis(title = "Sample length (mm)")

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)

chart1 |>
  add_data(data = data, titles_from_data = TRUE) |>
  set_categories(cats)
}

Run the code above in your browser using DataLab