Skip to contents

Wraps the <arcgis-chart> web component directly. Most users want arc_bar(), arc_scatter(), or arc_line(), which build the arguments for you.

Usage

arcgis_chart(
  i_layer,
  chart_type,
  config,
  tooltip = NULL,
  width = NULL,
  height = NULL,
  element_id = NULL
)

Arguments

i_layer

Defines the layer the chart reads, as built by as_feature_layer().

chart_type

Defines which default model the config merges over, such as "barChart". See ModelTypes.

config

Defines the chart configuration in the WebChart shape. May be sparse because the browser merges it over the defaults.

tooltip

default NULL. Defines extra tooltip rows as labels plus a lookup keyed by series and mark, as built by set_tooltip().

width, height

default NULL. Defines the widget size, passed to htmlwidgets::createWidget().

element_id

default NULL. Defines the DOM element id to render into.

Value

An htmlwidget.

Examples

df <- data.frame(species = c("a", "b", "c"), mass = c(1, 5, 3))

arcgis_chart(
  i_layer = as_feature_layer(df),
  chart_type = "barChart",
  config = arc_col(df, species, mass)@webchart
)