Simple steps to innovate legend design layout

Have you ever been short on real estate when designing a dashboard? When it comes to legends, we find it difficult to space just right so that the labels display legibly without wasting too much space. In this blog we will show simple steps to display color codes for values. We believe it is a more efficient layout that you can get creative with.

First example of a standard vertical legend. Legend occupies valuable space, labels are duplicated, and text labels are truncated.

Legend 1

Second example of a horizontal legend. Legend is still not wide enough to display the entire values. Colors are aligned the same order as on the axis but this layout requires 'eye-shifting' between legend colors and data line colors.

Legend 2

Still inspired by Edward Tufte's concepts (link to blog), we recommend creating a customized bar chart that serves as the axis label and color legend.

This solution integrates Tufte design principals to provide a better user experience. Features and benefits include:

  • Display data clearly - Enable the reader to focus on data and visual
  • Display full text value instead of trimmed values - Provide full information
  • Reduce chart junk - De-dup labels on axis and legend frees up valuable space
  • Eliminate overload - Align colors and values more intuitively, removing the burden of looking across multiple places for labels and associated colors.
  • Design clearly - Customizable format and layout
Let's walk through the steps to implement. Please note, throughout the example, we use Legend Label field as the dimension and Number of Records as the measure.

Step 1 Create a bar chart

Drag Number of Records to column shelf. Drag Legend Label to rows shelf

Legend 3

Step 2 Change Number of Records aggregation

Right click green Number of Records pill, change Number of Records aggregate from default to Minimum

Legend 4

Step 3 If it is not already, set Mark to Bar

Legend 5

Step 4 Add Legend labels to bar text

Drag Legend Label to Label text card (format, align)

Legend 6

Step 5 Hide Bar Chart object title

In title, right click, hide title

Legend 7

Step 6 Hide row header

Right click Label Dimension pill, unclick Show Header

Legend 8

Step 7 Freeze the x-axis

Right click x axis, General tab - Click Fixed button - Fixed start = 0 Fixed end =1, click apply

Legend 9

Step 8 Hide axis labels

Right click x-axis, uncheck Show Header

Legend 10

Step 9 Set color legend

Drag Legend Dimension to Color card. Double click Color shelf to edit/assign custom colors, format text label

Legend 11

Step 10 Size legend bars accordingly

Right click Size card and adjust. Adjust height of bars.

Legend 12

Pro tip - add context to bar chart/legend by adding metric to bar chart legend: Drag metric to label

Legend 17

Step 11 Add legend bar chart to dashboard visual

Format accordingly

Legend 13

Pro tip - align with visual: Set Legend object to floating, bring forward

Legend 14

Pro tip - avoid scroll bars: Right click Bar Chart object: Fit - Entire View

Legend 15

Compare results
Standard legend:

Legend 2

Customized bar chart axis and legend:

Legend 13

Use your own style to display a clean, clearly formatted, and legible legend. Happy developing!