# A live figure in your article

## The problem

You publish an article, a country page, or a dashboard that quotes development finance data. The OECD, the World Bank, or the IMF revise their data, and your chart goes out of date at their next revision. Redrawing it by hand every quarter is slow, and a pasted image has no source a reader can check.

A live chart solves both. You build the chart once in DFO Studio, share it as a live link, and paste its embed code into your page. Whenever a reader opens your page, the chart redraws with the DFO's data on that day. The text under it gives the source and links to the latest data.

## How it fits together

```mermaid
flowchart LR
  C["Studio card"] --> S["Live share"] --> E["Embed code"] --> P["Your page"]
  P -.->|"every load"| D["Datasets API"]
```

The share stores the card's spec (its `spec_id`). The `spec_id` is unchanged when the publisher revises the source, so the page fetches the newest `content_version` whenever it loads. [Versions and snapshots](/docs/data/versions) explains the two ids.

## A working example

1. In [Studio](/studio), ask "ODA to health in Nigeria since 2015" and keep the bar chart it draws.
1. Open the card's **⋮** menu, choose **Share**, then the **Embed** tab, and leave **Live Data** selected.
1. Wait while the dialog checks the card and "Adding the source and links…" clears, then select **Copy**.
1. Paste the code into your page's HTML where the chart should appear.

The code has three parts: the frame, the lines of text that a reader or a search engine gets without the frame, and the script that sizes the frame to its chart. Your copy contains your share's id, the card's title, and its source line:

```html title="Embed code for a live card"
<iframe src="https://developmentfinance.org/embed/AbC12345" width="100%" height="640" style="border:0" title="ODA to health in Nigeria"></iframe>
<p>Source: OECD Creditor Reporting System.</p>
<p><a href="https://developmentfinance.org/s/AbC12345">Latest data</a></p>
<script async src="https://developmentfinance.org/embed.js" data-origin="https://developmentfinance.org"></script>
```

Open your page and check that the frame shows the chart, with "Live data · titles and notes written" and a date under it. Keep the `title` attribute. Screen readers announce it as the frame's name.

## When not to use it

- When the numbers must match a printed text, use a snapshot. A live chart changes when the publisher revises the source. Use **Snapshot** in the same dialog and cite it as [Cite the DFO](/docs/data/cite) shows.
- When your page strips scripts or iframes, as some content systems do, link to the share. Without the script, the frame keeps its pasted height. Without the iframe, readers see only the text lines.
- When you want to draw the chart with another library, fetch the dataset with the [Datasets API](/docs/api/get-a-dataset) and draw it yourself.
- When the canvas has more than 20 data cards, split the canvas or share a snapshot. A live link can include up to 20.

## Reference

- [Use the website](/docs/start/use-the-website#share-a-result): live links, snapshots, and why a link can fail.
- [Embed a chart](/docs/build/embed): the embed code, its height, and troubleshooting.
- [Versions and snapshots](/docs/data/versions): `spec_id` and `content_version`.
- [Cite the DFO](/docs/data/cite): how to cite a chart that must not change.
