Incorporate Color Thoughtfully
Learning Objectives
After completing this unit, you’ll be able to:
- Encode shapes and sizes on marks to make them more accessible.
- Recall the minimum color contrast ratio to meet accessibility guidelines.
Formatting your visualization is key to both your analysis and your presentation. The use of color in visualizations is a great way to draw a user’s attention to important marks and highlight trends. But it’s important to keep accessibility in mind when working with color.
In the following example, the marks are all hollow blue circles. There’s a diverging blue color palette assigned, and some of the lighter marks have a low contrast with the white background. Only color and position are used to convey information. In this unit, you learn ways to make this viz more accessible.
Provide Visual Cues Beyond Color
The Web Content Accessibility Guideline (WCAG) for Use of Color comes under the Distinguishable section. The guideline states that “color shouldn’t be the only visual means of conveying information.”
When you use color for field values, also use other types of encoding for marks. For example, you can use size or shapes for the same field values to reinforce the differences between marks. Size and shape also convey information about your data.
Add Size to the Marks
To encode your marks with size, drag a field from the Data pane to Size on the Marks card.
To change the size of marks in the view, select Size on the Marks card and then drag the slider to the left or right.
Add Shapes to the Marks
To change the shapes of marks, drag a field from the Data pane to Shape on the Marks card. By default, 20 shapes are used to encode dimensions. If you have more than 20 dimensions, the shapes repeat. Repeating shapes isn’t an accessible experience. If this happens, reduce the marks in your view to fewer than 20.
If you don’t see a Shape option on the Marks card, expand the Mark type dropdown, which is likely set to automatic, and select Shapes.
Use Accessible Color Contrast
The WCAG recommendation for Contrast also falls under the Distinguishable section. The guideline states that the “colors chosen for text and images of text have a minimum contrast of 4.5:1.”
Tableau sets formatting defaults to make this easy when authoring a viz. For example, if your viz has a white background, and you enter the formatting controls for fonts, the default color palette is the Dark Palette, so that there’s sufficient contrast of the title with the background color. You can change the palette to the Light Palette, but in doing so, you reduce the accessibility.
Consider the following examples.
Example A:
Example B:
In example A, the title uses the Dark Palette, and is using the darkest shade of black on a white background. The text is also in boldface. In Example B, the title uses the Light Palette, and is using a light orange color. Example B isn’t accessible to anyone.
How do you know how much contrast the colors have? There are many free websites that you can use to check color contrast. We used the contrast checker webaim.org to check the contrast of these two colors. In Example A, the color contrast is 21:1. In Example B, the color contrast is 1.08:1. These are extreme examples, so let’s look at an example of the minimum contrast recommended: 4.5:1.
Example C shows a title that uses a color that is 4.54:1 contrasted with the background color.
Example C:
Most people automatically choose a color with sufficient contrast for titles and headers. But often, they don’t consider the contrast when choosing color palettes for marks. Make sure that if you’re using a diverging palette, the colors assigned to the marks on the light end of the spectrum meet the color contrast guidelines.
Use Built-In Tableau Color Palettes for Low Vision
All marks have a default color, even when there are no fields on Color on the Marks card. For most marks, blue is the default color; for text, black is the default color. These defaults meet the 4.5:1 color contrast minimum guideline.
When you drop a field with discrete values (typically a dimension) on Color on the Marks card, Tableau uses a categorical palette and assigns a color to each value of the field. Categorical palettes contain distinct colors that are appropriate for fields with values that have no inherent order, such as Customer Segment or Region.
The Color Blind palette can help you select colors that can be recognized by users with visual impairments. When you assign colors to different dimension values, make sure that they provide enough contrast and aren’t too close to each other on the light-dark spectrum.
The default color palette in Tableau products for discrete fields is Tableau 10. To change it, select Color on the Marks card, then select Edit Colors. Expand the Select Color Palette dropdown menu and select Color Blind.
A palette is assigned to the discrete values in your viz that can be recognized by most users with visual impairments.
Remember the viz at the beginning of this unit? Here’s what it looks like after revising it for accessibility.
- The viz now has size and shapes encoded to the marks—and color.
- There are two keys for the viz: one for shapes and one for color. They are for the same marks, but the shapes convey the information to those using assistive technology.
- The title of the viz is an accessible color contrast ratio.
- Each mark has a text label.
In this unit, you learned how to use different mechanisms in Tableau to convey information. And throughout this module, you explored how to take a viz from not very accessible to much more accessible.
Now you’re ready to incorporate all the elements that make vizzes more accessible–and contribute to our mission of helping all people see and understand data.