View source: R/dw_create_chart.R
| dw_create_chart | R Documentation |
stable Creates and returns a new Datawrapper chart object. This function starts the chart-making process
dw_create_chart(
api_key = "environment",
title = NULL,
type = NULL,
folderId = NULL,
theme = NULL
)
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 |
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 |
folderId |
Optional. Creates chart in specified folder. |
theme |
Optional. Creates chart with specified theme. |
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.
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
multiple-lines : Multiple Lines 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
If not specified, the new chart will by default be created without a title and with the type d3-lines.
Benedict Witzenberger
## Not run:
dw_create_chart()
## End(Not run) # uses the preset key in the .Renviron-file
## Not run: dw_create_chart(title = "Testtitle")
## Not run: dw_create_chart(api_key = "1234ABCD") # uses the specified key
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.