Writing Alt Text for Data Visualization

You probably can’t write text that conveys the entire meaning of a chart. But, that doesn’t mean that you shouldn’t try.

Amy Cesal
Nightingale
Published in
6 min readJul 23, 2020

--

alt= “Chart type of type of data where reason for including chart” Include a link to data source somewhere in the text

What is Alt Text

Alt text (sometimes called Alt tags or alternative text) are written descriptions added to images that convey the meaning of the visual. Good alt text helps more people understand the content. Assistive technology like screen readers reads the alt text out loud so users can hear and understand the visual content. People who use screen readers often have a vision impairment. This includes people who are totally blind, but also people with low or impaired vision.

Not writing alt text means that people miss out on content that is necessary, just because it’s visual. It means it’s not accessible.

Alt Text defined from Webaim:

It is read by screen readers in place of images allowing the content and function of the image to be accessible to those with visual or certain cognitive disabilities.

It is displayed in place of the image in browsers if the image file is not loaded or when the user has chosen not to view images.

It provides a semantic meaning and description to images which can be read by search engines or be used to later determine the content of the image from page context alone.

There are many resources for how to write alt text generally (I list more at the end of this piece), but few that provide guidance for how to write descriptions for data viz.

How to write for alt text for data visualization

So how do you write something short that conveys the whole meaning of a visualization? You probably can’t. That doesn’t mean that you shouldn’t try.

  • Adding alt text is better than not doing anything at all if there’s meaningful information in the image.
  • Add a long description if you can add HTML, to more fully convey the meaning.
  • Supplement with a link to the raw data, so curious readers can access the data in their own preferred program.
  • Keep your alt text short. Alt text is read linearly by screen readers, which means that people can’t go back a word if they missed something. For SEO purposes, Google cuts off after a certain amount of characters.

The World Wide Web Consortium (W3C), an international Web standards setting community, offers guidelines for alt text for complex images, but it can be difficult to interpret how to apply these to data visualization. Below, I interpret these guidelines to apply to charts and graphs. Refer to the W3C guidelines for nuance and compliance.

Here’s a simple formula for writing alt text for data visualization:

alt= “Chart type of type of data where reason for including chart” Include a link to data source somewhere in the text
Example alt-text format for data viz

Chart type

It’s helpful for people with partial sight to know what chart type it is and gives context for understanding the rest of the visual.
Example: Line graph

Type of data

What data is included in the chart? The x and y axis labels may help you figure this out.
Example: number of bananas sold per day in the last year

Reason for including the chart

Think about why you’re including this visual. What does it show that’s meaningful. There should be a point to every visual and you should tell people what to look for.
Example: the winter months have more banana sales

Link to data or source

Don’t include this in your alt text, but it should be included somewhere in the surrounding text. People should be able to click on a link to view the source data or dig further into the visual. This provides transparency about your source and lets people explore the data.
Example: Data from the USDA

Simple chart alt text example

Bar chart of gun murders per 100,000 people where America’s murder rate is 6 times worse than Canada, and 30 times Australia

If I was posting this chart from the New York Times article “How to Reduce Shootings” on social media I would include a link to the article and write this alt text:

Bar chart of gun murders per 100,000 people where America’s murder rate is 6 times worse than Canada, and 30 times Australia

Complex chart alt text example

Colored stripes of chronologically ordered temperatures where they increase in red to show the warming global temperature

If I was posting a less typical chart type like the Warming Stripes from Ed Hawkins, I would include a link to the source and focus on the meaning behind them for the alt text:

Colored stripes of chronologically ordered temperatures where they increase in red to show the warming global temperature

How to add alt text

In HTML code

Add alt text alt="" to any image that adds meaning inside the image tag <img>. Add a long description longdesc="" when possible.

On Twitter

When you add an image, use the add description button or +alt. Twitter has full instructions.

On Instagram

Instagram hides the alt text functionality, but there is documentation on how to add alt text.

  • Choose a filter and edit the image, then tap Next.
  • Tap Advanced Settings at the bottom of the screen.
  • Tap Write Alt Text.

In Microsoft Office Products

Microsoft Office has a variety of ways that you can add alt text depending on which program and what version you are using. However, they have extensive documentation on how to add alt text.

On Medium

Click on the image in the post. Use the “Alt text” label to write your text.

Image showing Medium interface for adding alt text

By writing effective alternative text or alt text and including it when you publish data visualization you provide a way for people who cannot see the image to understand the content so they are not missing out on critical information. Having alt text is necessary in order for the visual content to be accessible.

Other reading

Alt text

Accessibility for Data Viz

Thank you to Doug Schepers and Zander Furnas for reviewing

Correction: The article previously stated that screen readers cut off reading alt text at 125 characters. This is outdated information and has been revised. Thanks to Zoë Bijl and Kevin White for the update.

Amy Cesal is a designer specializing in data visualization. She is a co-founder of the Data Visualization Society and currently serves on the board. Amy is passionate about building style guidelines for data visualization, trying to make everything, including charts, accessible, creating bespoke data visualization and experimenting with the boundaries between data and art. She holds a masters in Information Visualization from MICA.

--

--

Amy Cesal
Amy Cesal

Written by Amy Cesal

Amy Cesal is a data visualization designer. She is a co-founder of the Data Visualization Society and serves on the board.

Responses (3)