% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sheet_add_drawing_dml.R
\name{sheet_add_drawing.dml}
\alias{sheet_add_drawing.dml}
\title{Add a dml drawing to an Excel sheet}
\usage{
\method{sheet_add_drawing}{dml}(
  x,
  value,
  sheet,
  left = 1,
  top = 1,
  width = 6,
  height = 6,
  ...
)
}
\arguments{
\item{x}{an rxlsx object (created by \code{\link[officer:read_xlsx]{officer::read_xlsx()}})}

\item{value}{a \code{\link[=dml]{dml()}} object}

\item{sheet}{sheet name (must already exist)}

\item{left, top}{left and top origin of the plot on the sheet in inches}

\item{width, height}{width and height in inches}

\item{...}{additional arguments passed to \code{\link[=dml_xlsx]{dml_xlsx()}}}
}
\value{
the rxlsx object (invisibly)
}
\description{
Add a \code{\link[=dml]{dml()}} object to a sheet in an xlsx workbook
created with \code{\link[officer:read_xlsx]{officer::read_xlsx()}}. The plot is rendered as
editable vector graphics (DrawingML).
}
\examples{
\donttest{
library(officer)
library(rvg)

x <- read_xlsx()
x <- sheet_add_drawing(x,
  value = dml(code = barplot(1:5, col = 2:6)),
  sheet = "Feuil1",
  left = 1, top = 2, width = 6, height = 6
)
print(x, target = tempfile(fileext = ".xlsx"))
}
}
