BookmarkSubscribeRSS Feed

How to use custom icons in geo-maps in SAS Visual Analytics

Started ‎09-10-2020 by
Modified ‎09-10-2020 by
Views 2,522

Recently, I came across some happiness data from The World Happiness Report that I wanted to build some visualizations around. To make it more “fun” I decided I would use custom faces to represent the country’s overall happiness score. 

 

 

Before diving into how we set this up in SAS Visual Analytics. I’m going to show you how I created the face icons using PowerPoint.

 

From the top menu, we’ll select the Insert item and then select Icons.

 

MelCar_1-1599589366413.png

 

 

Then we’ll select the three faces we want to use and select the Insert button.

 

MelCar_2-1599589366426.png

 

Next, we’ll change the image properties, such as fill, to get the image the way we want. In this case, I changed the fill to a red color.  Then we’ll save the image as a picture (right click on the image to get the menu).

 

MelCar_3-1599589366431.png

 

Because we want a clear background behind our image, we’ll choose PNG Portable Network Graphics Format (.png) for the Save as type.

 

saving image with clear background 2.png

 


 

We’ll repeat all the same steps to create the other two faces (happyface and mehface).

 

To use images, you’ll need to either choose Geo Coordinate or Geo region-coordinate object.  In the example above, I used Geo region-coordinate.

 

Once you’ve added your object to the report (under COORDINATE- COUNTRY if you are using a Geo Region-Coordinate object), you’ll assign your geography data item (in this example – Country) to the Geography role. If you want the size of the icon to represent a variable you can add that to the size role. In this example, the larger the face the greater the healthy life expectancy is.  Next, you’ll add the variable you want to use to determine which image to display as the color role.  In this example: If the countries happiness score is < 5 I want a sad face to display, if the country’s happiness score is between 5 and 6 I want a “meh” face and if the country’s happiness score is greater than 6 I want a happy face to display.  So, I’ll add score as my color role.

 

MelCar_5-1599589366477.png

 

Next, you’ll add Display Rules to the geomap.  This is where we’ll define criteria for which image we want displayed.

From the left pane, I’ll select Rules, then New Rule and choose Score under Coordinate-Country.

 

MelCar_6-1599589366496.png

 

 

Here, we’ll add our criteria when score is greater than 6. Then we’ll select the Style icon.

 

MelCar_7-1599589366499.png

 

Next, well select the Icon tab, Custom button and select Upload Local Image (note: SAS does provide some basic icons you can use if you don’t want to create your own).

 

MelCar_8-1599589366502.png

 

 

We’ll choose the happyface.png file that we created in PowerPoint, then select the Ok button.

 

MelCar_9-1599589366509.png

 

 We’ll select Ok again to exit out of the New Display Rule window and then we’ll create new rules for the other two faces.

 

MelCar_10-1599589366511.png

 

 

MelCar_11-1599589366514.png

 

 

MelCar_12-1599589366516.png

 

 

Here we have all the rules displayed in the Rules screen.

 

MelCar_13-1599589366528.png

 

Now our report displays custom icons based on our criteria with the size represented by healthy life expectancy.  I hope you found this helpful and have fun creating custom icons!

 

MelCar_14-1599589366623.png

 

To find more information about this report refer to the Analyzing happiness data in 2020 blog post.

 

Attribution:
Helliwell, John F., Richard Layard, Jeffrey Sachs, and Jan-Emmanuel De Neve, eds. 2020. World Happiness Report 2020. New York: Sustainable Development Solutions Network

 

 

Version history
Last update:
‎09-10-2020 01:22 PM
Updated by:
Contributors

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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