Apply colors to data points or series using color rules
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:
- Discrete Color Rule - used to apply a specific color to a member of a hierarchy.
- Auto Color Rule - used to apply a range of colors to a series.
- Range Color Rule - used to apply a specific color to a range of values.
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.
In the Data Analysis Panel, click Visualization, then click More... under TotalDue Series.
Drag the OrderDate hierarchy under COLOR. You can drag the hierarchy from the Explore panel or from elsewhere in the Data Analysis panel.
The color rules are now activated and discrete color rules are created for each value. Click the brush icon to the right of COLOR to open the Look properties.
Click the plus sign button to add a Discrete Color Rule or click an existing rule (for example, 2012) to edit it. Choose the color you want and the corresponding OrderDate hierarchy value.
Click the back button at the top of the properties to go back to the list of color rules.
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 under COLOR.
An Auto Color Rule is automatically created and applied to the chart.
Click the brush icon to the right of COLOR to open the related properties.
If not already opened, 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.
4. Apply a range color rule
Continuing from the previous example, click the back button at the top of the properties to go back to the list of color rules.
Click on the selection icon next to the plus in the Color Rules collection.
Select Range Color Rule to add a new rule.
Click the range color rule to edit it. Set To Value to 2000000, uncheck To Inclusive, and select a color.
5. See also
- Video: Configuring Metric Sets
- Using a data cube to join tables
- Create a metric set and add a filter
- Using chart properties
- Introduction to Data Binding
- Data Binding Examples