Assigning Color to Dimension Values

This feature applies to all visual types that use the Colors shelf: Bar visuals, Line visuals, Area visuals, Combined Bar/Line visuals, Interactive map visuals, Radial visuals, and Pie visuals.

Mapping colors to a specific dimension's values enables you to choose and modify a meaningful representation of values, such as 'green | red | amber' for 'success | failure | soft-fail'. You can select colors from a different palettes to specify color-value mapping, and also ensure that these colors are used consistently across all visuals within a dashboard by combing this feature with Colors are based on dimension values, described in Making Colors Consistent on Dimension Values.

In the following example, we show how to standardize colors for a grouped-bar visual built on the dataset CA College Readiness, build from the data in table ca-graduation-rates.csv.

You must perform these steps for each visual in the app.

  1. Open the visual in Edit mode, or create a new visual based on the following instructions:
    • From Dimensions, select County and place it on the X shelf.
    • From Measures, select Percentage Of Grads With College Required Courses and place it on the Y shelf. Change the aggregate to avg().
    • From Dimensions, select Gender and place it on the Colors shelf.
    • From Dimensions, select Year and place it on the Filters shelf. Select the year 2015 only.

    Click Refresh Visual.

    Basic grouped bar visual
    Grouped Bar Visual for Mapping Colors to Dimension Values
  2. Ensure that the relevant measure is on the Colors shelf. In our example, the measure that we are mapping to a specific color is Gender.
  3. Click Settings on the right side of the Visuals menu.

    selecting visual settings menu

    The Settings modal window appears.

  4. In the Settings modal window, click Color.
  5. Select Colors are fixed for the values specified...., and then scroll down in the modal to see the possible colors. Note that all possible dimension values from the Colors shelf appear in the list, with their default color.

    Mapping colors to dimension values option
    Mapping Colors to Dimension Values; Settings Color
  6. Changing the color assigned to a specific dimension value is very easy, especially when using the same color palette:

    1. Click on the color that you are changing (darker blue color that maps the value Male).
    2. In the palette pop-out that appears, select another color, such as the turquoise we used.
    3. Click Apply.
    New color from the same palette
    Selecting a New Color for a Dimension Value from the Same Palette; Settings Color
  7. Specifying a color from another palette is slightly different.

    1. Click on the palette where the new color can be found (the pink/purple palette).
    2. Click the color that you are changing (the pale blue that represents the dimension value Female).
    3. From the palette pop-out, select the new color. We used purple.
    4. Click Apply.
    New color from the same palette
    Selecting a New Color for a Dimension Value from a New Palette; Settings Color
  8. Click Refresh Visual, and note how the colors of the graph changed to reflect the new color-dimension assignments.

    Changes made through color-dimension assignments
    Selecting a New Color for a Dimension Value from the Same Palette; Settings Color

If the color you want to use is not in any of the palettes available to you, you can define it through the Custom Colors interface.