With the SAS Custom Graph Builder, you can create a huge variety of custom graphs. The SAS Graph Builder enables users to create custom visualizations that can be used as a graph object in a SAS Visual Analytics report. Check out GitHub - sassoftware/va-custom-graphs, which provides pre-built SAS custom graphs and their supporting files
One frequent question I get asked is how to create synchronized drill down in a hierarchy with multiple objects simultaneously. You can achieve this using the SAS Custom Graph Builder. These are the steps to take:
For this post, we will create a custom graph with two bar charts.
To access the Custom Graph Builder, access the SAS Viya Applications menu and click on Build Custom Graphs:
Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.
Then click on New Custom Graph:
From the Elements pane on the left, scroll down and drag the Bar Chart onto the canvas:
Then, drag another Bar Chart to the side of the existing one:
We now have created a user-defined lattice of graphs. Note you can of course use any number and combination of graphs for the synchronized hierarchies.
We now have to configure the roles of this custom graph. We need to indicate that all the graphs should share their Category role. To do this, click on the Roles pane on the right, and click the More menu next to Bar Chart 2 Category, then Create Shared Role with another Role and Bar Chart 1 Category. You can name the shared role Shared Hierarchy, which will accept any variables of Role Category. Click OK:
Note that the legend appears to be duplicated. This is because by default the legend of each constituting chart is displayed, which is not necessary as they share the Category role. To resolve this, in the Options pane on the right, under Discrete Legend, uncheck the checkbox for Bar Chart 2.
We have finished creating the custom graph. We now need to save it in a location accessible to all report creators wishing to use it. Report viewers do not need to access the custom graph. For the purposes of this post, I will save it in My Folder (note this means it is not accessible to anyone but me):
We can now return to Visual Analytics. To do this, from the Viya Applications menu, click on Explore and Visualize. Create a report and add data, or open an existing report. Every report creator wishing to utilise the custom graph needs to import it into Visual Analytics. To do this, from the right pane, select Objects, then select the Objects menu and click on Import custom graph.
Note that if you update the custom graph in Custom Graph Builder, you will need to delete the object from the Objects pane, and then re-import it into Visual Analytics.
Select your custom graph. Once imported, drag it onto the canvas of your report. Assign any hierarchy to the Category role and the other measures as you wish (see the first example in Creating Hierarchies to use in SAS Visual Analytics Reports for instructions on creating hierarchies and assigning it to an object). Then drill down by double-clicking on a segment in one chart. You will see that this will drill down into the hierarchy in the other chart as well:
This is just one example - you can use any number or combination of graphs for this synchronized drill down. Let your imagination run free!
Find more articles from SAS Global Enablement and Learning here.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.