BookmarkSubscribeRSS Feed

SAS Visual Analytics Display Rules: Graph – Level

Started ‎06-07-2023 by
Modified ‎07-19-2023 by
Views 678

This is the third post in a series about the available Display Rules in SAS Visual Analytics.

Recall from the previous articles, that there are three types of display rules. Here are examples for each type.

  • Color-mapped Value: based on a Category data item.
  • Expression: based on a measure data item expression.
  • Gauge: based on a measure data item interval definition.

 

The conditions are defined in the Rules pane. These Boolean expressions are evaluated for each visualization based on the assigned data Roles.

 

01_TypesOfDisplayRules_GraphLevel.png

Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.

 

SAS Documentation: Working with Display Rules.

 

Graph – Level

This article builds on the concepts and steps presented in the previous articles. I will not have all of the click paths enumerated in this article, but I will focus on the features, style combinations, options and considerations. If you need those steps, please refer to the Table – Level article.

 

I will cover the Graph – Level Display Rules. In general, most graph objects support two types of display rules:

  • Color-mapped Value
  • Expression

However, bear in mind, there are thirty different graph objects and ten different geo objects in SAS Visual Analytics and each object can have its own nuances. I have highlighted the Graph – Level in the below summary table, let’s take a look at a some examples.

 

02_Summary_GraphLevelHighlight.png

 

03_GraphAndGeoObjects.png

 

 

Graph – Level: Color-mapped Value Display Rule

For the below graph objects, I defined each display rule for each individual graph. Since I already covered Report – Level Display Rules in my previous article, I wanted to show how the different graph elements displayed the Color-mapped Value Display Rule. One of the major differences in a Report – Level and Graph – Level Color-mapped Value Display Rule is that at the Report – Level you can define it for any category across any data source in the report. This is not the case for a Graph – Level Color-mapped Display Rule where once you select a graph object, the display rule is tied to the data source and you must select either a single category data item or any category data item for that one data source for the rule definition.

 

I split this report page into two columns. On the left, I defined a Color-mapped Value Display Rule for the category data item Facility Region and on the right column for the category data item Product Line.

 

04_GraphLevel_ColorMapped.png

 

 

Left Column: Facility Region Color-mapped Value Display Rule You can see down the left column there is a Bar chart, Bubble plot, Box plot, and Word cloud. Right now, you are seeing the Display Rule in effect for all of these graph objects, but that is because I did not define a Color Data Role for either the Bubble plot or the Word cloud. If I had, then the Color Data Role takes precedence over the Graph – Level Display Rule.

 

05_WordCloud.png

 

Right Column: Product Line Color-mapped Value Display Rule On the right column, I have added a Pie chart, Treemap, and a Key value latticed by Product Line. Again, you are seeing the Display Rule in effect for these graph objects, but like the Word cloud above, if I assign a Color Data Role for the Treemap then that role assignment takes precedence over the Graph – Level Display Rule.

 

06_Treemap.png

 

You can also define Color-mapped Value Display Rules for Geo map objects. SAS Visual Analytics has ten different geo maps and not all display rule options are available for teach type, similar to the standard graph objects like above. Be sure to refer to SAS Documentation: Working with Display Rules for additional details.

 

The Geo bubble map, so long as you do not assign a Color Data Role, will evaluate the defined Color-mapped Value Display Rules. Here are two examples. Notice that for the lower map I have selected to plot the Facility State Geo data item but I am using the display rule to color the bubbles according to the values in Facility Region Geo. Also notice that I had to use the Any Category for that display rule.

 

The upper map is straight forward, where I use Facility Region Geo in both the Geography Data Role and in the display rule definition.

 

07_GeoBubble.png

 

This next feature of display rules for Geo map objects is very customizable. For only the Geo coordinate and Geo network map objects you can specify an Icon in place of the standard geo marker. In the below example, I used an icon that is in the shape of a building, but there are many out-of-the-box icons to select from. You can even upload your own custom icon but custom icons are static images and do not respond to the selected color as the standard icons do. I could have selected a different icon for each value in my display rule, but for this example, I kept them all the same.

 

08_GeoCoordinate.png

 

Next, I wanted to give an example using our Geo pie map object. This object was released with the LTS 2022.1 (May 2022) release and allows you to define a pie chart object to replace the geo marker. As you can see in this example, I defined my display rule to use the Product Line category data item.

 

09_GeoPie.png

 

Graph – Level: Expression Display Rule

Recall that when you define an Expression Display Rule you must select a measure data item and build a Boolean expression that when it evaluates to true, the rule is applied (if applicable) and when false, no rule is applied. Recall that we also learned in the Table – Level Display Rules article that we can layer and order Expression Display Rules. Keep in mind that the winning rule is the one at the top of the list, or the rule that is applied last.

 

One of the fantastic features about using an Expression Display Rule is that typically all the measures in the data source are available to use in the expression definition even if that measure is not assigned to a Data Role in that object.

 

In this below example, I am showing one of the Graph – Level Expression Display Rule options to select a Style Area: Graph or Background. On the left, I have selected the display rules to be applied to the Graph element. Where on the right, I defined the display rules to be applied to the Background element. We can see how the Graph affects the actual bar colors and the Background affects the area behind the bars.

 

This is one of those Expression Display Rule Options that is available for a subset of the graph objects. Generally, most graph objects only support the Style Area: Graph option since the background of some graph objects do not fall into such a defined range.

 

10_GraphLevel_Expression.png

 

In this next example, I use a Line chart graph object to demonstrate some of the Style Area: Graph or Background features. Notice that for each Line chart I have the Options: Markers turned on. Those are the filled circles at all of the data points. If you want to have the Line chart’s Expression Display Rule Style Area: Graph to be visible, then you must have selected Markers to be visible. The line itself will not change color depending on the display rule definition, only the markers, as you can see which filled circles are light green and dark green.

 

Now, for the Style Area: Background, you do not have to have Options: Markers turned on, but it makes it easier to see which data values are in the background display rule bands.

 

11_GraphLevel_Expression.png

 

Now let’s look at the Treemap and Word cloud objects again. We saw these earlier in the Color-mapped Value Display Rule section and we saw that if there was a Color Data Role assigned, then the Color Data Role took precedence over the Color-mapped Value Display Rule.

 

The good news is, when an Expression Display Rule is defined for these objects; it is the measure being evaluated and the display rule will be applied successfully even if there is a Color Data Role assigned. The object will display an Informational Warning letting us know that This report object uses rules that might conflict with essential color mapping. Use the Rules pane to remove the conflicts. This warning just lets us know that the object has default coloring based on Data Roles but that there are Display Rules which might negate the values.

 

Remember, one of the great things about using an Expression Display Rule is that all the measures in the data source are available to use in the expression definition even if that measure is not assigned to a Data Role in that object.

 

In this Treemap example, I do have the Expenses assigned to the Size Data Role.

 

12_Treemap.png

 

In the Word cloud example, I do not have the Expenses assigned to a Data Role. I used the same category data item, Product Description with the same Expression Display Rule definition for Expenses so you can see how the same values are colored.

 

13_WordCloud.png

 

Now let’s look at an example where an object has both a Style Area: Graph and Background display rule definition. Here I am using a Dual axis bar-line chart object. We can see how I have two different display rule definitions for each type of style area. Also notice, that in order to see the Style Area: Graph be applied to the Line chart, the Markers must be enabled.

 

14_DualAxisBar-Line.png

 

In this next example, I am also visualizing the category data item Month of Year but this time only the measure Unit Yield (rate). Notice that I have the same Expression Display Rule definition but for the Key value object there is no Style Area option.

 

15_KeyValue.png

 

I have two last Expression Display Rule examples I will show, both Geo map objects. The first is using the Geo region object. Now typically, when the Color Data Role is assign, the display rule will not be applied, but in this case, using an Expression Display Rule we can see that the regions are colored per the display rule definition.

 

16_GeoRegion.png

 

Next is the Geo coordinate map object so that I can show another icon example. As you can see here, I have an Expression Display Rule defined for the Expenses data item but this time I have two different icons: a sad red face for Expenses > 5M and a happy green face for Expenses <=5M.

 

17_GeoCoordinate.png

 

Summary

We have now explored many of the available Graph – Level Display Rules. I hope that by seeing some of these examples you can determine how to incorporate meaningful color into your reports!

 

18_Summary_GraphLevel.png

 

 

Here are some key things to remember for the Graph – Level:

 

Graph - Level

Color-mapped Value

Expression

  • If there is a Color Data Role assigned, then this value takes precedence over the defined display rule.

  • Usually, you can use any measure available in the data source and it does not always need to be assigned a Data Role in the object.

  • Some graph objects will have the option to define a Style Area: Graph or Background.

 

Here is a list of the supplemental enablement materials I mentioned in this article as well as other helpful resources:

 

Find more articles from SAS Global Enablement and Learning here.

Version history
Last update:
‎07-19-2023 02:04 PM
Updated by:
Contributors

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Labels
Article Tags