Developing Web Presentations with the GIF, JPEG, and PNG Device Drivers


You can use the GIF, JPEG, and PNG drivers with ODS to generate an HTML file to display multiple images. For details, see Generating an HTML Output File with ODS and the GIF, PNG, or JPEG Device Driver on page 445. For information on using these drivers without ODS, see Generating One or More GIF, JPEG, PNG Output Files Without ODS on page 444.

Enhancements that are available to GIF, PNG, and JPEG Web presentations include formatting of the HTML output file using ODS, as described in Overview of ODS Enhancements for Web Output on page 487, and adding drill-down or pop-up data-tip functionality. Drill-down functionality can be enabled in two ways. The elements of the graph can be hotspots, or the elements of an Annotate data set can be hotspots. For details, see Generating Drill-Down Web Presentations with the GIF, JPEG, or PNG Device Driver on page 447.

When to Use the GIF, JPEG, and PNG Device Drivers

The GIF, JPEG, and PNG device drivers are best suited to Web presentations with interactivity that is limited to drill-down functionality and that is implemented in an automatically generated image map in the HTML output file. If you need more interactivity, or if you want to compute responses to drill-down actions when the graph is viewed , then generate a presentation that runs in a Java applet or in the ActiveX Control.

If you do not need drill-down functionality, use the ACTXIMG or JAVAIMG device driver to generate a Web presentation with the best available image quality. These device drivers use an applet or the ActiveX Control to generate PNG image output files. The images can exhibit the color blending, transparency, anti-aliasing, and shading that are available in the graph styles, as described in Developing Web Presentations with the JAVAIMG and ACTXIMG Device Drivers on page 442.

Generating One or More GIF, JPEG, PNG Output Files Without ODS

To generate just one GIF, JPEG, or PNG image file, specify a fileref, filename, and storage location in a FILENAME statement, as follows :

 filename  fileref  "  your_path/your_file.image_extension  "; 

The fileref can be up to eight characters in length.

The following code shows how an actual FILENAME statement might look for one output image:

 filename mygif1 "C:\mysas\images\barchart.gif"; 

To generate multiple images in a single program, specify a fileref for the path only, as follows:

 filename  fileref  "  your_path  "; 

As shown in this example:

 filename imageout "C:\mysas\images"; 

When you generate multiple image output files, SAS/GRAPH automatically generates the names of the image files, as described in Naming Conventions Used for Image Output Files on page 445.

After assigning a fileref, all you need to add to generate an image output file are values for the graphics options DEVICE= and GSFNAME =, as follows:

 goptions device=  device_driver  gsfname=  fileref  ; 

The value of the GSFNAME= option is the name of your previously defined fileref, whether that fileref references a filename or a directory.

When you have specified a storage location and your DEVICE= and GSFNAME= graphics options, then you can run the procedure that generates the graph. The output will be stored in the specified format in the specified output location.

Generating an HTML Output File with ODS and the GIF, PNG, or JPEG Device Driver

Follow these steps to generate a complete Web presentation that consists of an HTML output file and one or more images:

  1. To conserve resources, close the ODS listing destination (the Output window, which is open by default). Then reset graphics options as follows:

     ods listing close;  goptions reset=all; 
  2. Enter your DATA step, if necessary.

  3. Specify your ODS HTML statement, with the following options:

     ods html     path=C:/Public/graph (url=none)/* HTML output directory */     body=webgif1.htm       /* HTML filename              */     gpath=C:/Public/graph; /* image file output location */ 

    Specifying URL=NONE tells ODS to reference the image file simply by name without prefixing the full path ( assuming that the image file is in the same directory as the HTML file).

    Note: With the GIF, JPEG, or PNG device driver, footnotes and titles are stored in the image file by default. To move footnotes and titles out of the image file and into the HTML file, specify the ODS HTML options NOGTITLE or NOGFOOTNOTE or both.

  4. Specify your device driver:

     goptions device=gif; 
  5. Run procedures to generate graphs. Each procedure ends with a RUN statement.

  6. Close the HTML output file and reopen the ODS listing destination:

     ods html close;  ods listing; 

    Reopening the listing destination establishes standard operating conditions for later programs that you run in the same SAS session.

Note: Using this technique, however, you can not create hotspots for links on your graphics or for data tips.




SAS.GRAPH 9.1 Reference, Volumes I and II
SAS.GRAPH 9.1 Reference, Volumes I and II
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 342

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net