Apply colors to data points or series using color rules
Use color rules to apply colors to data points or series based on hierarchy values. For example, you may want data points associated with a Bikes product category to always appear with a blue color.
For this example, drag OrderQty to the canvas as a measure.
Then add FirstName as a hierarchy on the ROWS axis.
Re-visualize the resulting visualization as a bar chart.
In the Data Binding Panel, click Bindings in the top-right corner.
Scroll down in the panel until you see SERIES 1 COLOR. Drag the FirstName hierarchy onto this field. You can drag the hierarchy from the EXPLORE window or from another field in this panel.
This is the hierarchy that will be used to define different color rule values.
The color rules for the chart are now activated. Close the Data Binding Panel and click PROPERTIES to see the properties of the chart.
Click Look, expand the APPEARANCE section, and find the Color Rules collection property.
Click the plus sign button to add a Discrete Color Rule.
Click the discrete color rule to edit it. Choose the color you want and the corresponding FirstName hierarchy value.
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.
3. Give each series a specific color
For this example, consider the following bar chart (metric set) which shows four different series. Each series corresponds to a specific product category such as Bikes or Clothing.
The steps are basically the same as before. For example, drag the Product hierarchy to the SERIES 1 COLOR field in the Bindings tab.
You can now go to PROPERTIES and add a color rule for each product hierarchy value.
4. See also
- Video: Introduction to Chart Styling
- 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