How to reverse graph axes in SAS Visual Analytics

2

It may never crossed your mind, but there are real-life cases when reversing graph axes make sense. For example, when Y-axis represents a depth under the sea level or depth of oil well drilling, it makes perfect sense to have zero on top and positive numbers increasing from top down. Or, when X-axis, represents time elapsed from some events in the past before some anchor event occurred, it make sense to have zero time on the right and positive numbers increasing going to the left.

This very useful feature of reversing axes in graphs is available in SAS Visual Analytics.  It’s a process that involves creating a custom graph template and then applying that template to your data in SAS Visual Analytics Report Designer. Here’s how in two quick steps:

Step 1.  Creating a custom graph template

Open the Custom Graph Builder found in the right pane of the SAS Visual Analytics Home page:

Open the Custom Graph Builder in SAS Visual Analytics

Then in the New Custom Graph window, select type of the graph that you want to build; for example, I selected Dual Axis Line Chart:

Select type of the graph in Custom Graph Builder

Select Properties tab in the right pane and then from the drop-down list select the object (axis) you want to change direction for. In the screenshot below, I selected Left Y Axis:

Select object (axis) in Custom Graph Builder

At this point, we are almost there; the solution is in plain view. Just check the Reverse order check box. Notice how left Y-axis changes its direction from top to bottom.

Check the Reverse order check box in Custom Graph Builder

Save your graph template and close out the Custom Graph Builder.  At this point, you are back to the SAS Visual Analytics Home page. Now, you can build your report.

Step 2. Applying the template to your report

From the SAS Visual Analytics Home page, open the Report Designer by clicking on one of the following – a Report Designer icon on the toolbar, Create Report button in the main area, or Report Designer link in the right pane:

SAS Visual Analytics Home page

When your Reports Designer opens, you might be disappointed when you see your newly created report template nowhere to be found. Here is a little help.

Click on the “Show or Hide Objects” icon in the top right corner of the Objects tab:

Click on Show or Hide Objects in SAS VA Reports Designer

Then select “Show or Hide Objects…” as shown in the next screenshot:

Select Show or Hide Objects in SAS VA Reports Designer

In the Show or Hide Objects pop-up window, find and check your newly created graph template, Reverse_left_Y_template, in the Custom section (you need to scroll down the window to find it) and press OK button:

Check newly created graph template in SAS Visual Analytics

After you return to the main Graph Builder window, you will be able to find your template in the very bottom of the Objects tab in the Custom section. Drag this report template and drop it to the report canvas:

Drag report template and drop it to the report canvas of SAS VA

Now you will have your left Y-axis in the reverse order (increasing from top to bottom):

Left Y-axis is in the reverse order now

At this point, all you need to do to complete your report is to define your data and assign roles, styles and other attributes for your report. Happy reporting!

Share

About Author

Leonid Batkhan

Leonid Batkhan, Ph.D. in Computer Science and Automatic Control Systems, has been a SAS user for more than 25 years. He came to work for SAS in 1995 and is currently a Senior Consultant with the SAS Federal Data Management and Business Intelligence Practice. During his career, Leonid has successfully implemented dozens of SAS applications and projects in various industries. All posts by Leonid Batkhan >>>

2 Comments

Leave A Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to Top