Apply colors to data points or series using color rules

Contents[Hide]

1. Overview

Use color rules to apply colors to data points or series based on their values. There are three types of color rules you may apply:

  1. Discrete Color Rule - used to apply a specific color to a member of a hierarchy.
  2. Auto Color Rule - used to apply a range of colors to a series.
  3. Range Color Rule - used to apply a specific color to a range of values.

Note
The following examples apply to charts, but the specific settings can be used in a table. See Using a table visualization for instructions.

2. Apply a discrete color rule

For this example, drag TotalDue to the canvas as a measure. Add OrderDate as a hierarchy on ROWS and re-visualize the resulting visualization as a bar chart.

Bar chart showing OrderQty by OrderDate
Bar chart showing OrderQty by OrderDate

In the Data Analysis Panel, click Visualization, then click More... under Series 1.

Data Analysis Panel - Visualization
Data Analysis Panel - Visualization

Scroll down in the panel until you see COLOR. Drag the OrderDate hierarchy onto this field. You can drag the hierarchy from the EXPLORE window or from another field in this panel.

Drag OrderDate hierarchy to COLOR
Drag OrderDate hierarchy to COLOR

The color rules for Series 1 of the chart are now activated. Click the brush icon to the right of COLOR to open the Look tab of PROPERTIES.

Expand the APPEARANCE section and find the Color Rules collection.

Color Rules collection
Color Rules collection

Click the plus sign button to add a Discrete Color Rule.

Discrete Color Rule added
Discrete Color Rule added

Click the discrete color rule to edit it. Choose the color you want and the corresponding OrderDate hierarchy value.

Choose the color and corresponding hierarchy value
Choose the color and corresponding hierarchy value

Note
In this example the default hierarchy level is set to Year. Changing the default level of the hierarchy will also change the members available in the color rule settings.

Click DISCRETE COLOR RULE at the top to go back to the list of color rules.

Add and configure more discrete color rules using the same steps.

Add more color rules
Add more color rules

Note
The color rules are applied to the hierarchy on this metric set. If you use the same hierarchy for the color of another series, the existing color rules will apply to it as well.

3. Apply an auto color rule

For this example, use the same bar chart setup as in the example above. Change the default OrderDate hierarchy level to Month.

This time, instead of OrderDate, drag the TotalDue measure onto the COLOR field.

Drag OrderDate hierarchy to COLOR
Drag OrderDate hierarchy to COLOR

An Auto Color Rule is automatically created and applied to the chart.

An Auto Color Rule is automatically applied
An Auto Color Rule is automatically applied

Note
The initially created auto color rule uses shades of blue. However, deleting and creating a new auto color rule would default to shades of grey.

Click the brush icon to the right of COLOR to open the Look tab of PROPERTIES.

Expand the APPEARANCE section and find the Color Rules collection.

Color Rules collection
Color Rules collection

Click Auto Color Rule to edit it:

  • Click on the plus next to From Value and enter 2000000. This will prevent values under 2M from being included in the color rule.
  • Click on the plus next to To Value and enter 7000000. Uncheck To Inclusive. This will prevent values over and including 7M from being included in the color rule.
  • Set Number Of Classes to 5 and the Distribution to Equal Interval. This will assign a different color to each million in the range.
  • Set From Color to Yellow and To Color to Red. This will create a range of colors where the hue changes from yellow to red as the values increase.

Edit the auto color rule
Edit the auto color rule

Note
Use Legend Text to customize how the ranges of values will be displayed in a legend. See the article on Formatting Text for syntax details. Use the Legend Category field to create a category name that groups the legend items created by this rule.

4. Apply a range color rule

Continuing from the previous example, click AUTO COLOR RULE to at the top to go back to the list of color rules.

Click on the selection icon next to the plus in the Color Rules collection.

Color rule selection
Color rule selection

Select Range Color Rule to add a new rule.

Select Range Color Rule
Select Range Color Rule

Click the range color rule to edit it. Set To Value to 2000000, uncheck To Inclusive, and select a color. 

Edit the range color rule
Edit the range color rule

5. See also

 

Dundas Data Visualization, Inc.
500-250 Ferrand Drive
Toronto, ON, Canada
M3C 3G8

North America: 1.800.463.1492
International: 1.416.467.5100

Dundas Support Hours: 7am-6pm, ET, Mon-Fri