| The GPLOT Procedure |
| Procedure features: |
| |||||||
| ODS features: |
| |||||||
| Other features: |
| |||||||
| Sample library member: | GPLDRIL1 |
This example shows how to create a plot with simple drill-down functionality for the Web. If you display the plot in a Web browser, you can select any plot point or legend symbol to display a report on monthly temperatures for the selected city.
The example explains how to use an ODS statement such as ODS HTML to generate a graph with drill-down links. It shows how to do the following actions:
explicitly name the HTML files and direct the different types of output to different files
use BY-group processing with ODS, and determine the anchor names for the different pieces of output
use the PATH= option to specify the destination for the HTML and GIF files created by the ODS statement
add an HTML HREF string to a data set to define a link target
assign link targets with the HTML= and HTML_LEGEND= procedure options
suppress the titles in the GIF files and display them in the HTML file
For more information on drill-down graphs, see Adding Links with the HTML= and HTML_LEGEND= Options.
This program modifies the code from sample GPLVRBL2, which shows how to generate separate plots for the formatted values of a classification variable. In this example, the code implements drill-down capability for the plot, enabling you to select any plot point or legend symbol to drill down to a report on the yearly temperatures for the corresponding city. The following figure shows the drill-down plot as it is viewed in a browser.
![[Drill-Down Plot]](images/gpldrl.gif)
The following figure shows the report that appears when you select any plot point or legend symbol that corresponds to the data for Raleigh.
![[Drill-Down Report]](images/gpldril1.gif)
| |
ods listing close; |
| |
filename odsout "c:\"; |
| |
goptions reset=all border device=gif; |
| |
ods html path=odsout gpath=odsout
body="city_plots.html"
nogtitle; |
| |
title1 "Average Monthly Temperature";
footnote1 j=l " Click a data point or legend symbol"
j=r "GPLDRIL1 ";
symbol1 interpol=join
value=dot; |
| |
proc gplot data=newtemp;
plot fahrenheit*month=city / hminor=0
html=citydrill
html_legend=citydrill;
run;
quit; |
| |
ods html close; ods html path=odsout body="city_reports.html"; |
| |
proc sort data=newtemp; by city month; run; quit; |
| |
goptions reset=footnote; option nobyline; |
| |
ods html close; ods listing; |
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.