> For the complete documentation index, see [llms.txt](https://govtnz.gitbook.io/nz-government-web-standards/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://govtnz.gitbook.io/nz-government-web-standards/content-accessibility/describing-charts-q.md).

# Images - describing charts

## Question

We were wondering which approach to go with for charts. We have a couple of options, e.g. longdesc that we use currently, figcaption, or aria-describedby to reference the text explaining the chart. Following this, I’m thinking we could put the data table in an accordion.

## Answer

Let’s assume that long descriptions will go in accordions (using details/summary implementation). If, in addition to a long description, the image also has a caption, then let’s also use figure/figcaption:

\<figure>

\<img…alt=“short description” longdesc=“fig1-desc”>

\<figcaption>Figure 1. Caption text\</figcaption>

\</figure>

\<details>

\<summary id=“fig1-desc”>Raw data for Figure 1.\</summary>

\<table>…\</table>

\</details>

See the second and third graphics at <https://webtoolkit.govt.nz/blog/2017/05/analytics-in-government-where-were-at/> for other examples.

If the image has no caption, then just an image with details/summary:

\<img…alt=“Jason’s great big smile” longdesc=“fig2-desc”>

\<details>

\<summary id=“fig1-desc”>Text description of Jason’s smile\</summary>

\<table>…\</table>

\</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://govtnz.gitbook.io/nz-government-web-standards/content-accessibility/describing-charts-q.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
