Plain HTML version:

Show source code
<form method="POST" target="_blank" action="https://app.datawrapper.de/create/">
    <input type="text" name="type" value="d3-lines" />
    <input name="title" type="text" value="This is the chart title" />
    <input name="description" type="text" value="Some more text to go below the headline" />
    <input name="source_name" type="text" value="ACME Inc." />
    <input type="submit" value="Create chart" />
    <textarea name="data">Quarter;iPhone;iPad;Mac;iPod
Q3 2000;;;1.1;
Q4 2000;;;0.6;
Q1 2001;;;0.7;
Q2 2001;;;0.8;
Q3 2001;;;0.8;
Q4 2001;;;0.7;
Q1 2002;;;0.8;
Q2 2002;;;0.8;
Q3 2002;;;0.7;
Q4 2002;;;0.7;
    </textarea>
</form>

JavaScript version:

Show source code
function openInDatawrapper(payload) {
    const form = document.createElement("form");
    form.setAttribute("method", "post");
    form.setAttribute("target", "_blank");
    form.setAttribute("action", "https://app.datawrapper.de/create/");
    Object.keys(payload).forEach((key) => {
        const input = document.createElement("input");
        input.setAttribute("type", "hidden");
        input.setAttribute("name", key);
        input.setAttribute("value",
            key === "metadata"
                ? JSON.stringify(payload[key])
                : payload[key]
        );
        form.appendChild(input);
    });
    document.body.appendChild(form);
    form.submit();
    document.body.removeChild(form);
}

More JS demos

show source code
openInDatawrapper({
    type: 'd3-maps-choropleth',
    title: 'Covid19 indicence per state',
    description: 'Maps can have descriptions, too',
    metadata: {
        axes: {
            keys: 'state',
            values: 'indicence'
        },
        visualize: {
            basemap: "germany-states"
        }
    },
    data: 'state,indicence\nNordrhein-Westfalen,187\nBaden-Württemberg,196\nHessen,180\nBremen,158\nNiedersachsen,119\nThüringen,227\nHamburg,105\nSchleswig-Holstein,74\nRheinland-Pfalz,143\nSaarland,143\nBayern,179\nBerlin,138\nSachsen-Anhalt,180\nSachsen,232\nBrandenburg,128\nMecklenburg-Vorpommern,139'
})
show source code
openInDatawrapper({
    type: 'd3-lines',
    title: 'Confirmed COVID–19 cases in <b style="border-bottom:3px solid #000000;">Europe</b>, per day',
    notes: 'Seven day rolling average of the number of people confirmed to have COVID-19, compared with the number of people who die and recover, per day (not including today). This chart gets updated once per day with data by Johns Hopkins. Johns Hopkins university didn\'t provide reliable data for March 12 and March 13.',
    source_name: 'Johns Hopkins CSSE',
    source_url: 'https://github.com/CSSEGISandData/COVID-19',
    external_data: 'htt
})