Html multiple graphs, how to?

Super Contributor
Posts: 418

Html multiple graphs, how to?

Hello everyone. I have code which goes through a macro loop to produce 10 different graphs by various graphs and at different levels. I would like to list all of these graphs in ONE file, so I am using HTML. THe issue is, when I do this 10 different gif files are produced, and if any of these are deleted, or not in the same directory as the HTML file, then the html file shows an X where that graphs picture should be.

Is there anyway to produce an HTML output (using ods html or ods output) that doesn't need to be in the same directory of the GIF's that produce the graphs?

If not, is there a way to produce only 1 GIF that contains 10+ pages of graphs instead of 10 individual graphs? An example of my code is given below.

html file="I:\Projects\BalanceGraphs.html";

goptions cback=white;

GRAPH CODE LOOPED, so for example;

%do i=1 %to 10;

proc gchart data=MYDATA;

vbar dsb_amount / discrete space=1;




ods html close;

Thanks for your help!

Super User
Posts: 13,518

Re: Html multiple graphs, how to?

Posted in reply to Anotherdream

I believe that's kind of the nature of the HTML beast, no native graphic format and EXPECTS to have links to images.

Since you are using Gchart you could look up the tender mercies of Proc Greplay. That will put multiple charts into a single image. Getting the size you want will require playing with vsize and hsize with goptions as the display for each included chart is expressed in term of percents of the display area.

You will be using Proc Template to create a custom layout for where to place the graphs. You may want to consider whether placing them as 2 across by 5 down may work as well as that is possible with Greplay.

Or send everything to RTF or PDF which will have the images imbedded.

Are you actually making 10 copies of the same graph or did you just not bother to show the incrementing of variable or dataset?

Another option though the size again may be an issue is proc sgpanel which can create a column, row or grid of charts.

Super Contributor
Posts: 339

Re: Html multiple graphs, how to?

Posted in reply to Anotherdream

It is possible to use DEVICE=ACTIVEX or JAVA as a goption so that the data points used to generate the graph and graph attribute (java object or active x control specific values).

The drawback is that this provides access to the data points or even raw data through the object or in the raw html file to users. It also does not support all styles and options but there's typically a way around getting the desired output.

The user does not need to have SAS installed as there is a prompt to download the appropriate activeX control from SAS website (default path) to view the graphs. Alternatively, if you work on a closed network, you could download a save of the activex EXE from and store it on a shared location and use an option (I forget which) to change the default path to prompt users lacking the activex control on their machine for download and install.

Anyway, this is really the only alternative if you want to keep on using html. This is in the nature of HTML as Ballard pointed out to need to be able to access the image locations.

Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation