UCLA Academic Technology Services HomeServicesClassesContactJobs
Search

SAS FAQ
How to can I create an interactive 3-D scatter plot as an ActiveX object using ODS?

The Output Delivery System (ODS) in SAS version 7 and higher provides a great deal of control over the output from SAS procedures including graphics. For example, ODS provides a simple way of creating interactive graphs as Microsoft ActiveX objects. An ActiveX object of a plot on a webpage allows a user to change the appearance of the plot interactively on the webpage. It is worth noticing that an ActiveX object only works on Internet Explorer and the ActiveX controls have to be enabled to make it work.

This page assumes that you use Internet Explorer version 6 and higher. With Internet Explorer version 6 and above, you can easily copy and paste any of the plot that you obtain by modifying the original one to other application programs, such as Word.

This FAQ page will show how to create a 3-d scatter plot as an ActiveX object embedded in a webpage.

It is very easy to create an ActiveX object from proc g3d.  Here is a sample code for creating an HTML page for the object. Our webpage will be called threeD.html and is located in the d:\temp folder.

options device = activex;
ods html body = 'd:\temp\threeD.html' ;
proc g3d data = hsb2;
  scatter write*math =read ;
run;
quit;
goptions reset = all;
ods html close;
ods listing;

Here is the link to the page that we just created. Now let's see what we can do with the plot. Remember at anytime that you want to get the original plot back, you can simply refresh the page. Please refer to our page on How to Create an Interactive 2-D Scatter Plot as an ActiveX object Using ODS for details on how to interact with the graph page. Here are some features that are more related to 3-D plots.

How to rotate the plot

You can rotate the 3-D plot by holding the Ctrl key and the left button of the mouse. After done with rotating, you may want to get the original plot back. You can right-click on the plot and from the View option, choose Reset View.


 

How to get rid of the needles

The plot you see first or when you refresh the page is like the following.



If you don't want to see the needles, you can right-click on the plot area and choose Scatter Options. Uncheck the Show needles option there to get rid of the needles.

  
 

You can also change the lighting on the plot. Holding down Ctrl and Alt key at the same time, then left click and hold on the mouse over the plot area. That changes the lighting over the plot, producing a better feel for the dimensions.

There are many other features that you may be interested in. The best way to learn it is to play with it.


How to cite this page

Report an error on this page

UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services


The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California