Skip to content

Bars & Areas (dataviz) ​

For implementation, see Tokens & CSS > Background or Border.

Bars and columns ​

Horizontal bar chart showing a dark blue bar, next to another bar with subtle blue fill and a darker blue border

When you are encoding data in bars and columns, you have two options:

  • Default Background. Example: background-primary
  • Subtle Background. Example: background-primary-subtle and border-primary

The subtle variant can be used alone or together with the default color to indicate something of less importance. The subtle colors need a 3 px border around the bar to achieve good enough contrast against the background.

You may also add a pattern inside the area when using the subtle background, see Patterns in bars and areas.

Optional: ChartBackground around bar ​

When bars are placed on top of gridlines and other data elements, it becomes harder to differentiate the bar from the elements below.

Consider adding a border (or slightly larger bar behind the data bar) with the ChartBackground/Default color. As a result, a small gap appears between the elements, making it easier to differentiate between them.

A blue bar with white outline placed on top of a blue line. The white outline is annotated with 'ChartBackground'

In Figma, this is implemented in the bar components.

Stacked bars and columns ​

Pro tip πŸ’‘

If you are creating stacked bar charts, add white space between each color to make it easier to identify each part.

If you add white space between each bar segment, and there are several stacked bars next to each, the white space should not affect the total hight/width of the stacked bars. Instead, remove the same amount of height/width from each bar segment (for example one pixel per bar segment). In this way, the total height/width of each stacked bar can be compared with one another.

Stacked bar with two bar segments, separated by a small white gap

In Figma, this is implemented in the stacked bar components.

Areas ​

For areas, such as area charts, there are a few options for color usage.

1. Default background ​

Area chart with intense blue color fill in light mode and dark mode

Use the default color, for example background-primary.

If you are creating stacked area charts, consider adding white space between each color to make it easier to identify each area.

2. Subtle background with border ​

Area chart with subtle blue color fill in light mode and dark mode

Large areas of the default Background color might become too intense. In that case, consider using the subtle background color combined with border. Example: background-primary-subtle and border-primary.

The border is only necessary on the part of the area that shows the values (typically the top, as in the example above).

You may also add a pattern inside the area, see Patterns in bars and areas.

3. Gradient with border ​

Area chart with gradient fading gradually from subtle blue at the top to background color at the bottom of the area, in light mode and dark mode

To make the area less prominent, consider using a gradient fill. Technically, this can be solved in different ways:

  • Make a gradient between the subtle background color and the chart background color. Example: background-primary-subtle to chartbackground.
  • Use opacity, and make the gradient between the same subtle background color with 100 % and 0 % opacity.

Include a border, similar to using a subtle background.

Patterns in bars and areas ​

Four bars with different colors and patterns: indigo with diagonal lines going up, green with tractor pattern, yellow with dots, and pink with diagonal lines going down

Patterns can make it easier to distinguish between categories, benefiting people with color deficiencies as well as those printing in gray scale.

In Figma, there is an option to apply patterns to bars. However, different dataviz libraries might have specific options for patterns, so it might be useful to consider the technical possibilities before choosing a pattern.

For patterns in bars or areas, use Background Subtle (or no fill) combined with Border colors. As a result, the border of the bar/area will have the same color as the pattern inside.

There is no particular mapping between dataviz colors and patterns, but be consistent if you apply patterns across graphs.

Note that extensive use of patterns can make the graph appear busy and chaotic, and thereby less accessible for many users.

Other methods you can use to distinguish between categories, reducing the need for patterns:

  • Text labels: connect text labels to categories for easy identification
  • Shapes or positions: Use different shapes or positions for different data categories
  • Fill and border: combine solid fill for one category with subtle fill and border for another category
  • Small multiples: split data into several small graphs to avoid relying on color coding
  • Filters: implement filters and popover information for interactive data exploration
  • Hover and focus states: show patterns on hover or with keyboard focus.

Prediction area ​

For prediction area, use the gray Secondary border color (border-secondary) with diagonal lines. For the background, use chartbackground, or no color at all.

Stacked bar chart with a wider box with a gray pattern behind each bar. Annotated with 'border'

Color tokens ​

Background (dataviz) ​

NameLight/Dark modeDescription
ChartBackground/Defaultwhite and black boxesWhite/Black background
Background/Primaryblue boxesBlue – if you only need one color
Background/Secondarygray boxesGray – for a secondary color
Background/Category1indigo boxesIndigo - representing category 1
Background/Category2yellow boxesYellow - representing category 2
Background/Category3pink boxesPink - representing category 3
Background/Category4green boxesGreen - representing category 4
Background/Category5orange boxesOrange - representing category 5
Background/Category6teal boxesTeal - representing category 6
Background/Category7blue boxesBlue - representing category 7
Background/Category8gray boxesGray - representing category 8
Background/Positivegreen boxesGray - representing something positive
Background/Warningyellow boxesWarning - representing something worrisome
Background/Negativered boxesRed - representing something negative
Background/Neutralgray boxesGray - representing something neutral

Background-Subtle (dataviz) ​

Needs a border to have enough contrast against the background.

NameLight/Dark modeDescription
Background/Primary-Subtleblue boxesBlue – if you only need one color
Background/Secondary-Subtlegray boxesGray – for a secondary color
Background/Category1-Subtleindigo boxesIndigo - representing category 1
Background/Category2-Subtleyellow boxesYellow - representing category 2
Background/Category3-Subtlepink boxesPink - representing category 3
Background/Category4-Subtlegreen boxesGreen - representing category 4
Background/Category5-Subtleorange boxesOrange - representing category 5
Background/Category6-Subtleteal boxesTeal - representing category 6
Background/Category7-Subtleblue boxesBlue - representing category 7
Background/Category8-Subtlegray boxesGray - representing category 8
Background/Positive-Subtlegreen boxesGray - representing something positive
Background/Warning-Subtleyellow boxesWarning - representing something worrisome
Background/Negative-Subtlered boxesRed - representing something negative
Background/Neutral-Subtlegray boxesGray - representing something neutral

Border (dataviz) ​

Border around Background Subtle.

NameLight/Dark modeDescription
Border/Primaryblue boxesBlue – border around Background/Primary-Subtle
Border/Secondarygray boxesGray border around Background/Secondary-Subtle
Border/Category1indigo boxesIndigo - border around Background/Category1-Subtle
Border/Category2yellow boxesYellow - border around Background/Category2-Subtle
Border/Category3pink boxesPink - border around Background/Category3-Subtle
Border/Category4green boxesGreen - border around Background/Category4-Subtle
Border/Category5orange boxesOrange - border around Background/Category5-Subtle
Border/Category6teal boxesTeal - border around Background/Category6-Subtle
Border/Category7blue boxesBlue - border around Background/Category7-Subtle
Border/Category8gray boxesGray - border around Background/Category8-Subtle
Border/Positivegreen boxesGray - border around Background/Positive-Subtle
Border/Warningyellow boxesWarning - border around Background/Warning-Subtle
Border/Negativered boxesRed - border around Background/Negative-Subtle
Border/Neutralgray boxesGray - border around Background/Neutral-Subtle