BookmarkSubscribeRSS Feed

How Upgrade Your VA Bubble Plots With Data Labels

Started ‎06-16-2020 by
Modified ‎06-16-2020 by
Views 2,413

I'm always looking for ways to make my Visual Analytics reports better. Sometimes, just a small change can greatly improve a report's usefulness and readability.

 

For example, if you have a standard bubble plot with several bubbles on it, continually referencing the graph's legend colors in coordination with the bubbles colors can be challenging. Take a look at the bubble chart below which plots the values of the sashelp.class data set. Each bubble represents an individual student. Does the orange bubble in the top right represent Alice or Phillip? 

bubblePlotLabels_01a.png

 

Difficult to tell, isn't it? Wouldn't it be easier if we could place each student's name label next to their associated bubble? Well guess what? Using the graph builder, you can! By making just a few small changes to the standard bubble plot, I was able to create this version of the graph:

 

bubblePlotLabels_02.png

The addition of the labels to the bubbles allows the user to easily see that the bubble in the top right represents Philip. Just this little change really improved the functionality of this report. In this post, I'll show you how to create a custom bubble plot graph that adds labels to your bubbles!

 

Step 1: Build the graph

 

Start by creating a new custom graph using the SAS® Graph Builder. Drag a Bubble Plot object onto the canvas:

 

bubblePlotLabels_03.png

 

With the bubble plot selected, from the right pane select the "Roles" menu. Click "Add Role":

 

bubblePlotLabels_04.png

 

At the next screen, select "Data Label" and press OK:

 

bubblePlotLabels_05.png

 

Now, still from within the "Roles" menu click "Add Role" again:

 

bubblePlotLabels_06.png

 

At the next screen, select "Group" and press OK:

 

bubblePlotLabels_07.png

 

Finally, (still from within the roles menu) click the three dots next to the newly created role "Bubble Plot 1 Data Label" and select:

"Create Shared Role With Another Role" -> "Bubble Plot 1 Group"

 

bubblePlotLabels_08.png

 

For the Role Name input "Bubble Plot Group" and press "OK":

 

bubblePlotLabels_09.png

 

And you're done! You've successfully built the custom graph. Save your graph and give it a name.

 

Step 2: Create the Report

 

For the example report displayed at the top of this post, I used the sashelp.class data set. To replicate this example, begin by first loading the sashelp.class data set into CAS and then creating a new Visual Analytics report and adding the data set to your report.

 

Now, our report is ready for our custom graph! All that's left for us is to import the custom graph to the Visual Analytics report we're working on.  Drag the custom graph into the report's canvas and apply the data roles as shown:

 

bubblePlotLabels_10.png

 

And that's it! You've successfully upgraded your bubble plot by adding labels to the data points! 

 

bubblePlotWithLabels.png

 

For this article, I did filter some of the data points to make the labels on the bubble plot easier to see. This filter can be seen in the completed Visual Analytics report which is available in this article's GitHub.

 

How to make this example work for you

This example was created in SAS Visual Analytics 8.5. For this article's data, I used the 'class' data set which is in the sashelp library.

 

On Github, you will find the following support files for this article:

  • A JSON file containing the completed custom graph - bubblePlotWithLabels_CG.json
  • A JSON file containing the completed report - bubblePlotWithLabels.json

 Take Me to GitHub!

 

 

Version history
Last update:
‎06-16-2020 01:24 PM
Updated by:
Contributors

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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