% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ms_chart.R
\name{ms_bubblechart}
\alias{ms_bubblechart}
\title{Bubblechart object}
\usage{
ms_bubblechart(data, x, y, size, group = NULL, labels = NULL, asis = FALSE)
}
\arguments{
\item{data}{a data.frame}

\item{x}{column name for x values.}

\item{y}{column name for y values.}

\item{size}{column name for bubble size values (must be numeric)}

\item{group}{grouping column name used to split data into series. Optional.}

\item{labels}{column names of columns to be used as custom data labels
displayed next to data points (not axis labels). Optional.
If more than one name is provided, only the first one will be used as a label, but all
labels (transposed if a group is used) will be available in the Excel file
associated with the chart.}

\item{asis}{logical parameter defaulting to FALSE. When FALSE, the data is
reshaped internally so that each series becomes a separate column. When TRUE,
the data is used as-is and must already have one column for categories and
one column per series.}
}
\value{
An \code{ms_chart} object.
}
\description{
Creation of a bubblechart object that can be
inserted in a 'Microsoft' document. A bubble chart is a scatter
chart where each point has a third numeric dimension controlling
its size.
}
\examples{
library(officer)

dat <- data.frame(
  x = c(1, 2, 3, 4, 5),
  y = c(10, 20, 15, 25, 30),
  sz = c(5, 10, 7, 15, 12),
  grp = rep("s1", 5)
)

bubble <- ms_bubblechart(
  data = dat, x = "x", y = "y",
  size = "sz", group = "grp"
)

# adjust axes to avoid clipping extreme bubbles
bubble <- chart_ax_x(bubble, limit_min = 0, limit_max = 6)
bubble <- chart_ax_y(bubble, limit_min = 5, limit_max = 35)
bubble
}
\seealso{
\code{\link[=chart_settings]{chart_settings()}}, \code{\link[=chart_ax_x]{chart_ax_x()}}, \code{\link[=chart_ax_y]{chart_ax_y()}},
\code{\link[=chart_data_labels]{chart_data_labels()}}, \code{\link[=chart_theme]{chart_theme()}}, \code{\link[=chart_labels]{chart_labels()}}

Other 'Office' chart objects: 
\code{\link{ms_areachart}()},
\code{\link{ms_barchart}()},
\code{\link{ms_chart_combine}()},
\code{\link{ms_linechart}()},
\code{\link{ms_piechart}()},
\code{\link{ms_radarchart}()},
\code{\link{ms_scatterchart}()},
\code{\link{ms_stockchart}()}
}
\concept{'Office' chart objects}
