[Stable] Creates and returns a new Datawrapper chart object. This function starts the chart-making process

dw_create_chart(
  api_key = "environment",
  title = "",
  type = "",
  folderId = "",
  theme = ""
)

Arguments

api_key

Required. A Datawrapper-API-key as character string. Defaults to "environment" - tries to automatically retrieve the key that's stored in the .Reviron-file by datawrapper_auth.

title

Optional. Will set a chart's title on creation.

type

Optional. Changes the type of the chart. E.g. "d3-bars" for bars, "tables" for a table. Default is "d3-lines". See the documentation for the different types or the Chart Types section below. If you do not set this here you can set it with dw_edit_chart()

folderId

Optional. Creates chart in specified folder.

theme

Optional. Creates chart with specified theme.

Value

It prints the new chart's id and returns a S3-structure of type dw_chart with the elements from the Datawrapper-API, the same as in dw_retrieve_chart_metadata.

Note

If not specified, the new chart will by default be created without a title and with the type d3-lines.

Chart Types

  • d3-bars : Bar Chart

  • d3-bars-split : Split Bars

  • d3-bars-stacked : Stacked Bars

  • d3-bars-bullet : Bullet Bars

  • d3-dot-plot : Dot Plot

  • d3-range-plot : Range Plot

  • d3-arrow-plot : Arrow Plot

  • column-chart : Column Chart

  • grouped-column-chart : Grouped Column Chart

  • stacked-column-chart : Stacked Column Chart

  • d3-area : Area Chart

  • d3-lines : Line Chart

  • d3-pies : Pie Chart

  • d3-donuts : Donut Chart

  • d3-multiple-pies : Multiple Pies

  • d3-multiple-donuts : Multiple Donuts

  • d3-scatter-plot : Scatter Plot

  • election-donut-chart : Election Donut

  • tables : Table

  • d3-maps-choropleth : Choropleth Map

  • d3-maps-symbols : Symbol Map

  • locator-map : Locator Map

Author

Benedict Witzenberger

Examples

if (FALSE) { dw_create_chart() } # uses the preset key in the .Renviron-file if (FALSE) dw_create_chart(title = "Testtitle") if (FALSE) dw_create_chart(api_key = "1234ABCD") # uses the specified key