Embed a sourced chart

A chart, its evidence and a link back to the data.

Line and bar charts

Open an indicator page and find “Embed this chart”. Copy the ID from its iframe URL into data-statorigin-chart. Keep the supplied ID exactly: it determines the measure, regions and chart type.

<div data-statorigin-chart="INDUSTRY--INDICATOR--trend" data-title="Chart title" data-source="PUBLISHER"></div>
<script src="https://statorigin.org/embed.js" defer></script>

Load the script once, even when embedding several charts. It creates a labelled iframe, adds a one-line attribution link under it and adjusts the height only for messages from that iframe. The existing line and bar charts provide point details and a data table. The embed displays the same published records as the indicator page.

Country maps

For a ranking with a “World map” section and SVG download, use its ranking slug below. Maps without that section are unavailable. The map retains source details in country tooltips; the linked ranking table provides values and citations, including territories too small to draw.

<div data-statorigin-map="RANKING-SLUG" data-title="Map title" data-source="PUBLISHER"></div>
<script src="https://statorigin.org/embed.js" defer></script>

The attribution link

The line under each embed reads “Data: PUBLISHER via StatOrigin”, naming the original publisher you put in data-source, or “Source: StatOrigin” without it. The anchor is the brand and the publisher, never the chart title, so an embed does not add keyword anchor text to your page.

The link is voluntary. Keep it, remove it, or mark it rel="nofollow": with the loader, set data-link="nofollow" or data-link="none"; in the iframe snippet, edit or delete the <p> line. The attribution bar inside the frame stays either way, and it is what carries the source and licence.

Accessibility and source terms

Give each chart a descriptive data-title; it labels the iframe for screen readers. Keep a normal link to the indicator or ranking in your article so readers can reach the data when scripts are blocked. The original iframe snippet works without the loader.

StatOrigin’s compilation is CC BY 4.0. Original sources retain their own terms. Cite the publisher and StatOrigin; preserve the period, unit and actual/estimate/forecast labels.

Dynamic pages

After adding embed containers, call window.StatOriginEmbed.mount(document). Already mounted charts are left intact. Your content security policy must allow scripts and frames from https://statorigin.org.