SAS Graphics for Java ®
Examples Using SAS AppDev Studio and the Output Delivery System ®
Wendy Bohnenkamp Jackie Iverson
™
The correct bibliographic citation for this manual is as follows: Bohnenkamp, Wendy, and Jackie Iverson. 2007. SAS® Graphics for Java: Examples Using SAS® AppDev Studio™ and the Output Delivery System. Cary, NC: SAS Institute Inc. SAS® Graphics for Java: Examples Using SAS® AppDev Studio™ and the Output Delivery System Copyright © 2007, SAS Institute Inc., Cary, NC, USA ISBN 978-1-59047-693-2 All rights reserved. Produced in the United States of America. For a hard-copy book: No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, SAS Institute Inc. For a Web download or e-book: Your use of this publication shall be governed by the terms established by the vendor at the time you acquire this publication. U.S. Government Restricted Rights Notice: Use, duplication, or disclosure of this software and related documentation by the U.S. government is subject to the Agreement with SAS Institute and the restrictions set forth in FAR 52.227-19, Commercial Computer Software-Restricted Rights (June 1987). SAS Institute Inc., SAS Campus Drive, Cary, North Carolina 27513. 1st printing, May 2007 SAS® Publishing provides a complete selection of books and electronic products to help customers use SAS software to its fullest potential. For more information about our e-books, e-learning products, CDs, and hardcopy books, visit the SAS Publishing Web site at support.sas.com/pubs or call 1-800-727-3228. ® SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration.
Other brand and product names are registered trademarks or trademarks of their respective companies.
Contents Acknowledgments Introduction
ix
xi
Part 1
SAS AppDevStudio
1
Chapter 1
Getting Started with SAS AppDev Studio
3
1.1 Tag Libraries for SAS AppDev Studio 3 1.2 Getting Ready to Add Graphs to Your SAS AppDev Studio Project 8 1.3 Your Data 10 1.3.1 Tips and Information 11
Chapter 2
SAS AppDev Studio Custom Tags and Attributes for Basic Graphs 13 2.1 SAS AppDev Studio 2 Tags 15 2.1.1 sasads:Bar 15 2.1.2 sasads:Combination 16 2.1.3 sasads:Pie 16 2.1.4 sasads:Scatter 17 2.1.5 sasads:SegmentedBar 17 2.2 SAS AppDev Studio 3 Tags 18 2.2.1 sas:BarChart 18 2.2.2 sas:BarLineChart 19 2.2.3 sas:LineChart 20 2.2.4 sas:LinePlot 21 2.2.5 sas:PieChart 22 2.2.6 sas:RadarChart 23 2.2.7 sas:ScatterPlot 24 2.3 Common Attributes 25
iv Contents
Chapter 3
SAS AppDev Studio 3 Graph Model Tags 39 3.1 3.2 3.3 3.4 3.5 3.6 3.7
Chapter 4
BarChartModel 40 BarLineChartModel 50 LineChartModel 64 LinePlotModel 67 PieChartModel 74 RadarChartModel 87 ScatterPlotModel 92 3.7.1 Baselines 97
Nested Tags for Graph Models
99
4.1 Axis Models 100 4.1.1 Response Axis Baseline Models 107 4.1.2 Corresponding Graph Models 108 4.1.3 Column and Row Axis Models 110 4.2 Legends 111 4.2.1 Corresponding Graph Models 113 4.3 Line Style Tags 113 4.3.1 Corresponding Graph Models 116 4.4 Text Style Tags 116 4.4.1 Corresponding Graph Models 117 4.5 AxisWallModel 118 4.6 BackgroundFillStyle 119 4.6.1 Corresponding Graph Models 122 4.7 DataElementStyle 123 4.8 DataTipModel 123 4.9 SubgroupLabelModel 124
Chapter 5
Supporting Tags
125
5.1 Fill Tags 126 5.2 Line Tags 130 5.2.1 AxisLineStyle, GridLineStyle, StrokeLineStyle, FrameLineStyle, and OutlineLineStyle 5.2.2 BasicStroke 133
Contents v
5.3 Text Tags 133 5.3.1 Font 133 5.3.2 LabelTextStyle and ValueTextStyle 134 5.3.3 TextStyle 136 5.3.4 ShadowStyle 136 5.4 Tick Mark Tags 136 5.5 Miscellaneous Tags 137 5.5.1 DiscreteFillColor 137 5.5.2 MarkerStyle 137 5.5.3 ReferenceLineModel 140
Part 2 Chapter 6
Output Delivery System
Important Concepts for Getting Started with ODS and Java 145 6.1 6.2 6.3 6.4 6.5
Chapter 7
143
Java Scriptlet Code 146 General JSP Structure 146 General JSP Requirements 148 Connecting and Data Extraction 148 A Few Last Notes about Data 151
Creating Graphs
153
7.1 Types of Bar Charts 154 7.1.1 Horizontal Bar Charts 154 7.1.2 Vertical Bar Charts 155 7.2 Types of Pie Charts 156 7.2.1 Pie Charts 157 7.2.2 Donut Charts 158 7.2.3 Star Charts 159 7.3 Contour Plots 159 7.4 Types of Maps 160 7.4.1 Block Maps 160 7.4.2 Choropleth Maps 161 7.4.3 Prism Maps 162 7.4.4 Surface Maps 163 7.5 Types of Plots 163 7.5.1 Bubble Plots 164 7.5.2 Plots 165
vi Contents
7.6 Three-Dimensional Graphs 166 7.6.1 Scatter Plots 166 7.6.2 Surface Plots 167
Chapter 8
Parameters for Colors 169 8.1 ODS Parameters 170 8.1.1 Non-supported parameters 181 8.2 GOPTIONS 182 8.2.1 Non-supported options 186 8.3 PROC GCHART 186 8.3.1 Summary 192 8.3.2 Non-supported parameters 193 8.4 PROC GCONTOUR 193 8.4.1 Summary 197 8.5 PROC GMAP 197 8.5.1 Summary 199 8.6 PROC GPLOT 199 8.6.1 Summary 204 8.7 PROC G3D 204 8.7.1 Summary 205 8.7.2 Non-supported parameters 205
Chapter 9
Parameters for Text
207
9.1 ODS Parameters 208 9.1.1 Non-supported parameters 213 9.2 GOPTIONS 214 9.2.1 Non-supported parameters 217 9.3 PROC GCHART 217 9.3.1 Summary 225 9.3.2 Non-supported parameters 226 9.4 PROC GCONTOUR 227 9.4.1 Summary 231 9.5 PROC GMAP 232 9.5.1 Summary 234 9.6 PROC GPLOT 234 9.6.1 Summary 238
Contents vii
9.7 PROC G3D 239 9.7.1 Summary 240
Chapter 10 Other Parameters
241
10.1 PROC GCHART 242 10.1.1 Summary 264 10.1.2 Non-supported parameters 10.2 PROC GCONTOUR 268 10.2.1 Non-supported parameters 10.3 PROC GMAP 273 10.3.1 Summary 277 10.3.2 Non-supported parameters 10.4 PROC GPLOT 278 10.4.1 Summary 289 10.4.2 Non-supported parameters 10.5 PROC G3D 290 10.5.1 Summary 298 10.5.2 Non-supported parameters
Part 3
Putting It Together
Chapter 11 Final Reports
267 272
278
289
298
299
301
11.1 Report 1: Using SAS AppDev Studio 3 Tags 301 11.2 Report 2: Using ODS 307 11.3 Conclusions 310
Appendix A
SAS/GRAPH Samples and WORK Data Sets
References
315
Index
317
313
viii
Acknowledgments Thanks to Aimee for inspiration, Andrew for support, Jackie for courage, Mom for believing, and the readers for their interest. Wendy Bohnenkamp
Until I started this, I never knew just how much time and effort go into writing a book. This is hard work, and I first have to say thank you to Wendy for putting up with me as a writing partner. Without her knowledge, skill, and drive, this book would never have been finished. Next, I need to thank my family for their encouragement and support. And finally, I have to say thanks to the people who buy this book. If the examples in this book make their job easier, then it will have been worth the effort. Jackie Iverson
x
Introduction The idea for this book started glimmering every time we would lament to each other about the lack of good examples. The conversation always ended with “someone should write a book.” This book is intended to be that source for examples. We walk you though the basics and ® help to get you familiar with things that may be new to you or new to SAS 9. The book can be used by programmers at all experience levels. This book covers only the graph objects in SAS AppDev Studio, and it is assumed that you already know how to use SAS AppDev Studio to create and deploy a JavaServer Page (JSP) or servlet application. A basic level of SAS ODS programming knowledge is also needed to understand the example code in Part 2. ®
SAS 9 and SAS AppDev Studio 3 were released while we were writing this book. All ® examples have been tested on SAS 9. SAS AppDev Studio contains both the older version of graph custom tags as well as the new versions. Therefore we briefly cover version 2 tags, but concentrate more on the version 3 tags. There are many parameters and attributes to cover, so the intent is to provide a reference tool to help you build your own graphs. We’ve focused on what we feel are the two main ® ways programmers are using SAS 9 to create graphs using Java. There are four main sections to this book. The first is what you are reading now. Just a “Hi how are you?” and a “Here’s the intent of this book.” The second section covers webAF and SAS AppDev Studio. It includes a brief how-to section on using webAF as an Interactive Development Environment (IDE) and briefly discusses SAS AppDev Studio 2 tags and their options. Then it covers the tags and the nesting properties of SAS AppDev Studio 3 tags. The third section is intended for SAS programmers who want to do some reporting but who are not that familiar with custom tags. This section covers using Output Delivery System (ODS) statements and the Java Device Driver to create graphs. Then we wrap everything up in the fourth section to include reference and appendix materials. This book is not intended to give you all the answers to all the questions about SAS graphs. It is also not a “best practice” type of cookbook. We are merely trying to put together a reference volume that enables you to see what you can and cannot do to make your graphs more visually appealing. For instance, when you are combining ODS and JSP files, you get a very diverse environment. We have decided to simplify our examples by putting everything in a single JSP instead of using servlets, macros, stored processes, etc. We wanted to focus on the attributes, parameters, and options that make graphs convey what you really want them to convey.
xii Introduction
Because we are focusing on the look of the graph, we chose data that helped to illustrate the specific graph attribute. This produced graphs that may not represent a real world situation. So don’t get hung up on trying to analyze the graph; just look at what it is trying to show. Appendix A contains data layouts of the SAS samples and WORK data sets that were used to produce the graphs. Most of the time we used data sets from the SAS/GRAPH samples library to make it easy for you to reproduce the graph. Part 3, “Putting It Together,” explains where to find the sample data sets. If we had to create or modify the data to get a particular attribute to show more clearly, we included the SAS code in Appendix A. Each sample that produces output has been tested in our local development environment. We have tried to provide you with information on what works and what may not. We included things that did not work for us, because in your environment or in future updates they could. If you see an option or parameter that you like, give it a try. SAS offers many opportunities for creativity. We hope to give you a jump start on the path to great graphs. Ready to tackle those SAS graphs?
P a r t
1
SAS AppDev Studio Chapter 1 Getting Started with SAS AppDev Studio 3 Chapter 2 SAS AppDev Studio Custom Tags and Attributes for Basic Graphics 13 Chapter 3 SAS AppDev Studio 3 Graph Model Tags 39 Chapter 4 Nested Tags for Graph Models 99 Chapter 5 Supporting Tags 125
2 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
C h a p t e r
1
Getting Started with SAS AppDev Studio 1.1 Tag Libraries for SAS AppDev Studio 3 1.2 Getting Ready to Add Graphs to Your SAS AppDev Studio Project 8 1.3 Your Data 10 1.3.1 Tips and Information 11
1.1 Tag Libraries for SAS AppDev Studio In this section we are going to look at creating graphs in a JavaServer Page (JSP) using the SAS Custom Tag Library. This tag library comes with the SAS AppDev Studio product, which includes webAF as the development environment tool. You can use webAF or another Java Interactive Development Environment (IDE), such as Eclipse, to utilize the tag libraries and API components that come with SAS AppDev Studio.
4 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
SAS AppDev Studio 2.x and SAS AppDev Studio 3 use separate tag libraries. SAS AppDev Studio 3 introduced some major enhancements to the graphics components. We’ll look at the most commonly used graphs in each version. The easiest way to add graphs to your JSP or servlet project in SAS AppDev Studio is to use the Component Palette. The graph components are on the Graphics tab. You can change the palette by clicking the down arrow on the toolbar title bar.
We will be working with graphs on the SAS JSP/Servlet (Version 3) and SAS JSP/Servlet (Version 2) palettes. The version 2 tag library is part of SAS AppDev Studio 3. When you create a new SAS AppDev Studio 3 project, you can choose to include the version 2 tag library so that these tags are available in the component palette. When you upgrade an existing webAF 2 project to use webAF 3 components, your old SAS AppDev Studio 2 tags (which have a sasads prefix) will still be in your project and will not be automatically updated to SAS AppDev Studio 3 tags (with a sas prefix). In other words, if you have a sasads:Bar chart in your project, it will not automatically be converted to a sas:BarChart if you move to webAF 3. Here is an overview and comparison of the graphs available in both versions. Remember that sasads tags are from SAS AppDev Studio 2, whereas sas tags are from the more recent SAS AppDev Studio 3. sasads:Bar
sas:BarChart
Chapter 1: Getting Started with SAS AppDev Studio 5
Here is a direct comparison of the default bar charts. Notice that the default for sasads:Bar is a three-dimensional chart, whereas the sas:BarChart is two-dimensional. Both have several options that can enhance the appearance. sasads:SegmentedBar
sasads:Combination
sas:BarLineChart
The sasads:SegmentedBar tag really does not have an equivalent in SAS AppDev Studio 3. However, you can mimic this graph by using the various model attributes with the sas:BarChart tag.
The sasads:Combination tag can be used in several different ways to perform similarly to a sas:BarLineChart, sas:LineChart, or sas:ScatterChart tag.
This sas:BarLineChart tag has no direct partner in SAS AppDev Studio 2 tags.
6 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
sas:LineChart
sasads:Pie
In SAS AppDev Studio 3, line charts can be created using the sas:LineChart tag. In SAS AppDev Studio 2, you might consider using the sasads:Combination tag.
sas:PieChart
As with the bar charts, sasads:Pie defaults to a three-dimensional chart, and sas:PieChart is two-dimensional. Both charts have loads of options to create a number of different looks. Additionally, the sas:PieChart tag can create a donut and subgroup data into concentric rings.
Chapter 1: Getting Started with SAS AppDev Studio 7
sasads:Scatter
sas:ScatterPlot
SAS AppDev Studio 2 includes the sasads:Scatter tag. The equivalent tag in SAS AppDev Studio 3 is sas:ScatterPlot.
sas:LinePlot
The sas:LinePlot tag could be compared to the previously shown SAS AppDev Studio 2 sasads:Combination tag.
8 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
sas:RadarChart
The sas:RadarChart tag is a brand-new graph type for SAS AppDev Studio 3.
1.2 Getting Ready to Add Graphs to Your SAS AppDev Studio Project There are a couple of things you need to consider before you can add graphs to your project. One is how to connect to the data. In your development environment, everything is local and easy to get to, but in normal production environments that usually isn’t the case. You need to plan your strategy for accessing your SAS server. Is security an issue? How many people will be accessing this application? How many people at the same time might need to grab the same data? All these questions should be discussed with both the Web server and SAS server administrators. These administrative roles may be filled by the same person or by people from different groups. Either way, you must plan and coordinate with them. There are so many variables and combinations of system setup that we can’t cover all of them in this book. For this book, we’ve taken a simple approach and used a basic Java Database Connectivity (JDBC) connection for SAS AppDev Studio 3 tags and SAS/CONNECT for all others. If you need something more elaborate for your environment, review the SAS documentation for SAS Integration Technologies. This resource will help you make decisions on setting up security, pooling, connection types, etc. Now that you have the connection, the next step is to create data models. Data models allow you to shape the data for graphing. For instance, you might need to sort the data alphabetically or by increasing values. Data models can also specify the columns, subset the data, and perform other functions.
Chapter 1: Getting Started with SAS AppDev Studio 9
In SAS AppDev Studio 2, one common method is to use a sasads:DataSet tag. This allows us to use the connection, specify the data, and shape it. Here’s an example: <sasads:DataSet connection="bbuConnection" dataSet="samples.grains" id="dsBar" scope="session" displayedColumns="country amount" />
In this example, we use the bbuConnection object to connect to our SAS server. Then the dataSet attribute is used to define the data set we want to use. Here we are using the Grains data set from the Samples library. Then, to help shape the data, we use the displayedColumns attribute. This allows us to specify only the columns we will be needing for the graph. When using the SAS AppDev Studio 3 tags, we need to use different types of models. These may seem more complicated than simply using the sasads:DataSet tag, but they are more flexible. For sas:BarChart you use a com.sas.graphics.components.barchart.BarChartTableDataModel. Here’s an example:
<jsp:useBean id="barChartTableDataModel1" scope="session" > <jsp:setProperty name="barChartTableDataModel1" property="model" value="" />
This snippet of code shows the configuration of a data model. It references a JDBCTableModelAdapter and sets properties for the data model, such as the category and response variables to use. See Chapter 11, “Final Reports,” for a complete example with SAS AppDev Studio 3 tags.
10 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
1.3 Your Data When you are using SAS data sets in SAS graphs, there are specific terms used to describe the types of variables. For instance, you may think in terms of an X axis and Y axis. However, because we are looking at statistical or computed variable data, most of the time each variable has a role. On the X axis you may actually be charting data by a category variable. Below are some terms that may help you along the way. Category variable A variable that determines the number and arrangement of bars, slices, lines, etc. Response variable The variable you are trying to understand, explain, or model. Midpoint The value associated with a bar on a bar or block chart or the slice on a pie chart. This is the category variable. Chart variable The data column to be charted. This variable can be character or numeric. Chart statistic Most commonly, the sum of a numeric variable or the frequency (count) of a character variable. Other common statistics are percentages and means. The statistics available vary by type of graph. Midpoint axis The axis that shows the categories of data. Response axis The axis that shows the range of values for the chart statistic. Contiguous variables Variables that contain a range of numeric values that are represented on the chart. For example, dollars or quantities are contiguous variables.
Chapter 1: Getting Started with SAS AppDev Studio 11
Discrete variables Variables that contain a finite number of specific values that are represented on the chart. For example, years, geographical areas, and company divisions are discrete variables. X Used in plots (vertical) to identify the variable on the horizontal axis. Y Used in plots (vertical) to identify the variable on the vertical axis. Z Used in plots (vertical) to identify the depth variable. For more information on terminology and graphing basics, see the SAS OnlineDoc documentation.
1.3.1 Tips and Information Here are a few tips on how to organize your data for maximum performance.
Usually, you should presummarize large data sets to improve performance.
When there are too many values to represent in a pie chart, the smaller values are automatically grouped into one slice labeled “Other.” By creating your own “Other” grouping, you can prevent a smaller, but important, category from being hidden.
When you are accessing SAS data, the system often puts a lock on the data set you are using. For this reason, be sure to close all connection to the data once you are done. Or consider making your connection read-only and investigate how to set up workspace pooling or connection sharing techniques.
If you have a large number of different categories, you might want to subset or group the data to control the number of bars or pie slices shown in the chart. Depending on the size of your chart, it is easy to get so many bars that you cannot read the labels.
In short, the saying “Garbage in, garbage out” is so true. You need to be careful of how your data is constructed and formatted before you base critical decisions on your output.
12 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
C h a p t e r
2
SAS AppDev Studio Custom Tags and Attributes for Basic Graphs 2.1 SAS AppDev Studio 2 Tags 15 2.1.1 sasads:Bar 15 2.1.2 sasads:Combination 16 2.1.3 sasads:Pie 16 2.1.4 sasads:Scatter 17 2.1.5 sasads:SegmentedBar 17 2.2 SAS AppDev Studio 3 Tags 18 2.2.1 sas:BarChart 18 2.2.2 sas:BarLineChart 19 2.2.3 sas:LineChart 20 2.2.4 sas:LinePlot 21 2.2.5 sas:PieChart 22 2.2.6 sas:RadarChart 23 2.2.7 sas:ScatterPlot 24 2.3 Common Attributes 25
14 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
SAS AppDev Studio gives the user a number of graphing custom tags to use with JSP pages. The tags available in SAS AppDev Studio 2 have been updated in SAS AppDev Studio 3. Although SAS AppDev Studio 2 tags are easier to use because they are not nested, they are limited in what they can and cannot display. You might be tempted at first to run with the SAS AppDev Studio 2 tags, but once you get the hang of SAS AppDev Studio 3 tags, we think you’ll jump right in with both feet. In general, the standard convention for SAS AppDev Studio 3 tags looks like this: <sas:BarChart id="bbuSASBarChart" model="barChartTableDataModel1" scope="session" >
However, if there are no nested tags, you could use the following convention. The difference is that the tag is closed using a single backslash at the end of the invocation of the tag. <sas:BarChart id="bbuSASBarChart" model="barChartTableDataModel1" scope="session" />
Be very careful not to use both conventions at the same time. If you accidently use /> and then have nested tags, the compiler won’t recognize the nested tags as being part of that tag group. If you need to nest tags, use the following convention and insert the nested tags where shown. <sas:BarChart id="bbuSASBarChart" model="barChartTableDataModel1" scope="session" >
Each graph tag has three required attributes. The id attribute gives the object a name. Each object in your scope must have a unique identifier or name. The model attribute specifies the data model. The scope attribute defines the limit of the object’s availability, such as session, request, page, or application. <sas:BarChart id="bbuSASBarChart" model="barChartTableDataModel1" scope="session" >
Chapter 2: SAS AppDev Studio Custom Tags and Attributes for Basic Graphs 15
2.1 SAS AppDev Studio 2 Tags The following graph examples illustrate the basics of the different graphing custom tags available from SAS AppDev Studio 2. These older tags are still available with SAS AppDev Studio 3. However, as stated before, you might want to convert to the newer SAS AppDev Studio 3 tags. The main difference in syntax between the two is the prefix used for the tags. The prefix “sasads:” denotes AppDev Studio 2 tags, whereas “sas:” denotes SAS AppDev Studio 3 tags.
2.1.1 sasads:Bar To create a bar chart using the SAS AppDev Studio 2 tags, use the sasads:Bar tag.
<sasads:Bar id="bbuBar" model="dsBar" scope="session" />
16 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
2.1.2 sasads:Combination A combination of a bar and line chart can be created using the sasads:Combination tag. Because combination charts handle many different variables, the tag requires a few more attributes by default to produce a readable graph. These attributes are categoryVariableName, responseVariableName, and subGroupVariableName.
<sasads:Combination id="bbuCombination" model="dsBar" scope="session" categoryVariableName="year" responseVariableName="amount" subGroupVariableName="country" />
2.1.3 sasads:Pie The sasads:Pie tag creates a pie chart.
<sasads:Pie id="bbuPie" model="dsBar" scope="session" />
Chapter 2: SAS AppDev Studio Custom Tags and Attributes for Basic Graphs 17
2.1.4 sasads:Scatter You can create a scatter chart using the sasads:Scatter tag.
<sasads:Scatter id="bbuScatter" model="dsBar" scope="session" />
2.1.5 sasads:SegmentedBar You can create a stacked bar chart using the sasads:SegmentedBar tag. As with the combination chart, there are more variables to define with a segmented bar chart. The attributes used to define these variables are categoryVariableName, responseVariableName, and subGroupVariableName.
<sasads:SegmentedBar id="bbuSegmentedBar" model="dsBar" scope="session" categoryVariableName="year" responseVariableName="amount" subGroupVariableName="country" />
18 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
2.2 SAS AppDev Studio 3 Tags In SAS AppDev Studio 2, you only need a DataSetInterface or sasads:DataSet tag to define your data. However, with SAS AppDev Studio 3, each chart type can be built using its own data model. Therefore, in each example of a basic graph we have included the code that builds the table data model for each graph type. For instance, with the sas:BarChart tag the corresponding table data model is the com.sas.graphics.components.barchart.BarChartTableDataModel class. Using this code allows you to customize your data more than you can by using the sasads:DataSet tag.
2.2.1 sas:BarChart The sas:BarChart tag creates a basic bar chart. By customizing the table data model, you can also transform the basic bar chart into a stacked bar chart to represent different subgroups of data.
<jsp:useBean id="barChartTableDataModel1" scope="session" > <jsp:setProperty name="barChartTableDataModel1" property="model" value="" /> <sas:BarChart id="bbuSASBarChart" model="barChartTableDataModel1" scope="session" >
Chapter 2: SAS AppDev Studio Custom Tags and Attributes for Basic Graphs 19
2.2.2 sas:BarLineChart The sas:BarLineChart tag can create bar charts that have a corresponding line chart attached. This enables you to see two different types of data per category.
<jsp:useBean id="barLineChartTableDataModel1" scope="session" > <jsp:setProperty name="barLineChartTableDataModel1" property="model" value="" /> <sas:BarLineChart id="bbuSASBarLineChart" model="barLineChartTableDataModel1" scope="session" >
20 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
2.2.3 sas:LineChart The sas:LineChart tag creates a line chart. A line chart shows the relationship of one variable to another. Typically these variables have only one corresponding value on the vertical axis. This type of chart is best suited to business-oriented graphs that plot values against other discrete categorical values.
<jsp:useBean id="lineChartTableDataModel1" scope="session" > <jsp:setProperty name="lineChartTableDataModel1" property="model" value="" /> <sas:LineChart id="bbuSASLineChart" model="lineChartTableDataModel1" scope="session" >
Chapter 2: SAS AppDev Studio Custom Tags and Attributes for Basic Graphs 21
2.2.4 sas:LinePlot You can create a line plot using the sas:LinePlot tag. A line plot is typically used to plot x and y variables, one of which may have contiguous values. In this example, the population (POPDEN) is a contiguous value, and the territories (IDNAME) are discrete values.
<jsp:useBean id="linePlotTableDataModel1" scope="session" > <jsp:setProperty name="linePlotTableDataModel1" property="model" value="" /> <sas:LinePlot id="bbuSASLinePlot" model="linePlotTableDataModel1" scope="session" >
22 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
2.2.5 sas:PieChart The newer sas:PieChart tags can create three-dimensional pie charts, ringed pie charts, and donut charts. Section 3.5 explains how to use attributes to create the various types of pie charts.
<jsp:useBean id="pieChartTableDataModel1" scope="session" > <jsp:setProperty name="pieChartTableDataModel1" property="model" value="" /> <sas:PieChart id="bbuSASPieChart" model="pieChartTableDataModel1" scope="session" >
Chapter 2: SAS AppDev Studio Custom Tags and Attributes for Basic Graphs 23
2.2.6 sas:RadarChart The sas:RadarChart tag is new to SAS AppDev Studio. The spokes that radiate from the center of the chart can be used to show the frequency of data measures. These charts are often used in quality control and market research.
<jsp:useBean id="radarChartTableDataModel1" scope="session" > <jsp:setProperty name="radarChartTableDataModel1" property="model" value="" /> <sas:RadarChart id="bbuSASRadarChart" model="radarChartTableDataModel1" scope="session" >
24 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
2.2.7 sas:ScatterPlot You can create a scatter plot using the sas:ScatterPlot tag. Scatter plots show a relationship between one variable and another. They can be very helpful in revealing trends in the data.
<jsp:useBean id="scatterPlotTableDataModel1" scope="session" > <jsp:setProperty name="scatterPlotTableDataModel1" property="model" value="" /> <sas:ScatterPlot id="bbuSASScatterPlot" model="scatterPlotTableDataModel1" scope="session">
Chapter 2: SAS AppDev Studio Custom Tags and Attributes for Basic Graphs 25
2.3 Common Attributes The following are common attributes that affect the look and feel of SAS AppDev Studio 3 graph tags. These attributes can be applied to any of the base level graph tags. For each attribute we review the code that creates the output as well as the HTML that is generated. This way if you are familiar with HTML it will give you some idea of how the output is constructed.
alignment To adjust the alignment of a chart within the page you can use the alignment attribute. Valid values: Top Bottom Middle Left Right
<sas:BarChart id="bbuSASBarChart" model="barChartTDM1" scope="session" alignment="RIGHT" >
This attribute is applied to the HTML image tag, so it does little to adjust the alignment on a page by itself. You can insert this tag into a HTML table to position the graph on the page.
26 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
alternateText The alternateText attribute enables you to define text that is displayed when the user hovers over graph areas where data points do not exist, such as the axis areas and labels. In the HTML source, this text is defined by the alt attribute applied to the HTML tag. Valid values: <String>
<sas:BarChart id="bbuSASBarChart" model="barChartTDM1" scope="request" alternateText="Alternate Text when Hovering" >
Once this code is rendered, the compiled HTML code looks similar to this:
Chapter 2: SAS AppDev Studio Custom Tags and Attributes for Basic Graphs 27
appliedColorSchemeName To apply a predefined color scheme to your graph, you can use the appliedColorSchemeName attribute. This attribute is applied as a preprocessing event to create the image. Therefore no HTML tags are generated to apply the color scheme. Valid values: Autumn Carnival Grayscale Magellan Ocean Picnic Terra Woodland
Bright Commerce Industry Neon Pastel Pine Wheat
<sas:PieChart id="bbuSASPieChart" model="pieChartTDM1" scope="request" appliedColorSchemeName="Carnival" >
28 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
appliedGraphStyleName The appliedGraphStyleName attribute is very similar to the appliedColorSchemeName attribute. This attribute also applies predefined textures and modifies the look and feel of the graph with more than just colors. Valid values: Analysis Banker Convention Education Gears Money RSVP Sketch Torn
Astronomy Blockprint Curve Electronics Magnify Monochrome Science Statistical Watercolor
<sas:BarLineChart id="bbuSASBarLineChart" model="barLineChartTDM1" scope="request" appliedGraphStyleName="Watercolor" >
Have fun with these. You can find examples of the predefined graph styles at http://support.sas.com/rnd/gendoc/bi/api/Components/com/sas/graphics/components/docfiles/style-Grid.html.
Chapter 2: SAS AppDev Studio Custom Tags and Attributes for Basic Graphs 29
borderWidth To put a border around your graphics area you can use the borderWidth attribute. This attribute enables you to apply a border and control the thickness. Valid values:
<sas:BarChart id="bbuSASBarChart" model="barChartTDM1" scope="request" borderWidth="5" >
When this tag is rendered, the border is actually applied to the HTML tag that produces the graph. Here is an example:
30 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
epilog You can add text to the graph area at the bottom by using the epilog attribute of the graph tag. Valid values: <String>
<sas:BarChart id="bbuSASBarChart" model="barChartTDM1" scope="request" epilog="Epilog Text" >
The epilog is actually created after the image has been created. This is added as straight HTML text on your page.
Chapter 2: SAS AppDev Studio Custom Tags and Attributes for Basic Graphs 31
Epilog Text <map name="bbuSASBarChart"> <area shape="polygon" alt="COUNTRY: Australia AMOUNT: 31167" coords="86,241,86,241,169,241,169,253,86,253,86,253"> <area shape="polygon" alt="COUNTRY: Canada AMOUNT: 71894" coords="189,227,189,227,272,227,272,253,189,253,189,253"> <area shape="polygon" alt="COUNTRY: US AMOUNT: 514046" coords="291,76,291,76,374,76,374,253,291,253,291,253">
Notice where the “Epilog Text” string is posted on the page after the image but before the map. The map was automatically generated by the graph tag. In this example, it provides hover text that shows the country name and amount.
galleryImageVisible The galleryImageVisible attribute enables you to control whether your graphs are resizable on the page. In Microsoft Internet Explorer there is a setting under Tools Î Internet Options Î Advanced Î Multimedia called “Enable Automatic Image Resizing.” This option, when checked, resizes images that may be too large to fit in the browser window area. The galleryImageVisible attribute sets this option on or off using a True or False value. Set to False, the graph image cannot be resized regardless of the user’s Internet Explorer browser settings. Valid values: Boolean (True/False)
32 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
height The graph’s height can be set using the height attribute. This attribute applies a height attribute to the HTML tag once it is rendered. Valid values:
<sas:LineChart id="bbuSASLineChart" model="lineChartTDM1" scope="request" height="450" >
Be aware that the radar chart does not resize the image, but rather allots the space to use for the graph area. Therefore the radar chart is the same size, but the height attribute may create more white space around the perimeter.
Chapter 2: SAS AppDev Studio Custom Tags and Attributes for Basic Graphs 33
horizontalSpace You can use the horizontalSpace attribute to provide padding or white space on the sides of the image. Valid values: <sas:BarChart id="bbuSASBarChart" model="barChartTDM1" scope="request" horizontalSpace="200" >
When the tag renders the image, it applies an hspace attribute to the HTML tag, similar to this:
image The image attribute allows you to set the source of the chart you are trying to display. Although this attribute sounds fairly straightforward, we have not found any practical uses for it.
34 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
prolog Similar to the epilog attribute, the prolog attribute applies text to the outside of the graph area. The difference is that the prolog is applied before the graph is resolved. Valid values: <String>
<sas:BarChart id="bbuSASBarChart" model="barChartTDM1" scope="request" prolog="Prolog text" >
The resulting HTML code looks similar to this: Prolog text
<map name="bbuSASBarChart"> <area shape="polygon" alt="COUNTRY: Australia AMOUNT: 31167" coords="86,241,86,241,169,241,169,253,86,253,86,253">
Chapter 2: SAS AppDev Studio Custom Tags and Attributes for Basic Graphs 35
<area shape="polygon" alt="COUNTRY: Canada AMOUNT: 71894" coords="189,227,189,227,272,227,272,253,189,253,189,253"> <area shape="polygon" alt="COUNTRY: US AMOUNT: 514046" coords="291,76,291,76,374,76,374,253,291,253,291,253">
Notice that the string “Prolog Text” is applied to the HTML stream before the image and map areas.
render To disable or delay the display of a specific graph, you can use the render attribute. This takes a Boolean value (True or False). The default value is True. If it is set to False, the graph does not display with that particular invocation of the graph tag. However, if you reference the graph tag later in the HTML file, you can display the graph at that time by changing the render value to True. Valid values: Boolean (True/False) <sas:BarChart id="bbuSASBarChart" model="barChartTDM1" scope="request" render="FALSE" >
This tag can be valuable in lots of applications. For example, you might want to display or not display the graph based on some passed parameter. Therefore you could do something like the following: <sas:BarChart id="bbuSASBarChart" model="barChartTDM1" scope="request" render="" >
This code takes a parameter pulled from the session or request (isRendered) and applies that passed string directly to the tag. You should be careful when doing this to make sure the value is indeed a string representing a Boolean value (True or False).
36 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
verticalSpace The verticalSpace attribute is similar to the horizontalSpace attribute. The difference is that white space is applied to the top and bottom (vertical spaces) of the graph area. Valid values: <sas:BarChart id="bbuSASBarChart" model="barChartTDM1" scope="request" verticalSpace="200" >
This padding is accomplished when the tag renders the image. It applies a vspace attribute to the HTML tag, similar to this:
width To adjust the width of the graphics area, you can use the width attribute with the graphics tag. Valid values:
<sas:BarChart id="bbuSASBarChart" model="barChartTDM1" scope="request" width="450" >
Chapter 2: SAS AppDev Studio Custom Tags and Attributes for Basic Graphs 37
Here is the resulting HTML source:
Note that the width is applied directly to the HTML tag. This can cause you some problems. For instance, take one of the plots with longer labels. The labels will unfortunately be shortened automatically. This might not be the desired affect, as shown below.
38 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
C h a p t e r
3
SAS AppDev Studio 3 Graph Model Tags 3.1 BarChartModel 40 3.2 BarLineChartModel 50 3.3 LineChartModel 64 3.4 LinePlotModel 67 3.5 PieChartModel 74 3.6 RadarChartModel 87 3.7 ScatterPlotModel 92 3.7.1 Baselines 97
This chapter covers graph model tags. Graph model tags are used to control the data elements in the graph. This type of tag is nested inside the top-level graph tag. In the JSP, the nested tags look like this: <sas:BarChart > <sas:BarChartModel >
40 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
We have discussed the attributes of the top-level tag (in this case sas:BarChart). Now we want to discuss the attributes of the graph model. In these examples, we still show the output and the code, but there is no HTML source to review, because the nested tag works on the output before it is delivered to the screen. At the beginning of each graph model tag, we show you the tags in context. Then for each attribute we only show the nested tag portion.
3.1 BarChartModel The sas:BarChartModel tag is used within the sas:BarChart tag. Here is an example of the appropriate nesting syntax: <sas:BarChart > <sas:BarChartModel >
antialiasedGraphics The antialiasedGraphics attribute of the BarChartModel tag smooths the edges when set to True, which is the default. In some system environments, the difference is insignificant. For this reason, we do not provide an example of the output for any of the antialiased attributes. Valid values: Boolean (True/False) <sas:BarChartModel antialiasedGraphics="true" >
Chapter 3: SAS AppDev Studio 3 Graph Model Tags 41
antialiasedText Similar to the antialiasedGraphics attribute, the antialiasedText attribute smooths the edges of text in the output. The default value is True. Valid values: Boolean (True/False) <sas:BarChartModel antialiasedText="true" >
barShape You can change the shape used to represent the bar using the barShape attribute. Currently only two shapes are available: a rectangle (which is the default) and a cylinder. This attribute can be changed only when the dimension attribute of the graph is set to 3D. Valid values: Rectangle Cylinder Requirements: dimension=“3D” <sas:BarChartModel barShape="Cylinder" dimension="3d">
42 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
barWidth You can use the barWidth attribute to set the display property of the bars in the bar chart. If the graph becomes too crowded, the applet automatically resizes the bars to accommodate them. Valid values: <Measure> The <Measure> value can be px (pixels), pt (points), cm (centimeters), or in (inches). Examples of valid values: 50px, 3cm, 1in
<sas:BarChartModel barWidth="100pt">
barWidthSpace To set the width of the white space around each bar, you can use the barWidthSpace attribute. Valid values: <Measure> The <Measure> value can be px (pixels), pt (points), cm (centimeters), or in (inches). Examples of valid values: 50px, 3cm, 1in
Chapter 3: SAS AppDev Studio 3 Graph Model Tags 43
<sas:BarChartModel barWidthSpace="100pt">
dimension To set the aspect to 3D, you can use the dimension attribute. The default is 2D. The example shows the attribute set to 3D. Valid values: 2D 3D
<sas:BarChartModel dimension="3d">
insideBarLabelContent The insideBarLabelContent attribute enables you to set the type of information to be displayed inside the bar. Valid values: Automatic None Category Response Sum Mean Percent Subpercent
<sas:BarChart id="insideBarLabelContent_SASBarChart" model="barChartTDM1" scope="session
44 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
appliedColorSchemeName="Carnival"> <sas:BarChartModel insideBarLabelContent="Percent">
Note: The reason we have used the appliedColorSchemeName attribute here is that the default text color for the label content was too dark on an already dark bar (blue). We changed to a lighter color scheme so that the text would show up better.
missingPolicy The missingPolicy attribute sets the behavior of the graph for displaying missing values. There are three values: Automatic, True, and False. The Automatic setting displays all missing values for classification variables except those for category variables. The True setting displays all missing values, whereas the False setting does not display any missing values for classification variables. The first graph shown has the attribute set to True, whereas the second one is set to False. Valid values: Automatic True False
<sas:BarChartModel missingPolicy="true" >
Chapter 3: SAS AppDev Studio 3 Graph Model Tags 45
orientation To switch back and forth from a horizontal to a vertical bar chart, you can use the orientation attribute. The first graph shown has a value of Horizontal, whereas the second one is Vertical.
Valid Values: Horizontal Vertical <sas:BarChartModel orientation="Horizontal" >
46 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
outsideBarLabelContent Similar to the insideBarLabelContent attribute, the outsideBarLabelContent attribute enables you to set data to be displayed just outside of each bar. This example uses the value Percent. Valid values: Automatic None Category Response Sum Mean Percent
<sas:BarChartModel outsideBarLabelContent="Percent">
response2AxisLowerThreshold To set a low threshold value on the response2 axis, use the response2AxisLowerThreshold attribute. This attribute enables you to earmark those values that may negatively exceed an expected amount below the baseline.
Chapter 3: SAS AppDev Studio 3 Graph Model Tags 47
Valid values: <sas:BarChartModel response2AxisLowerThreshold="-10.0" >
response2AxisUpperThreshold You can also set an upper threshold to the response2 axis by using the response2AxisUpperThreshold attribute. The upper threshold must be greater than the baseline value.
Valid values: <sas:BarChartModel response2AxisUpperThreshold="12.0" >
responseAxisLowerThreshold To set a low threshold value on the response axis, use the responseAxisLowerThreshold attribute. This attribute enables you to earmark those values that may negatively exceed an expected amount below the baseline.
48 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
Valid values: <sas:BarChartModel responseAxisLowerThreshold="-15.0" >
responseAxisUpperThreshold You can also set a upper threshold to the response axis by using the responseAxisUpperThreshold attribute. The upper threshold must be greater than the baseline value.
Valid values: <sas:BarChartModel responseAxisUpperThreshold="6.0" >
Chapter 3: SAS AppDev Studio 3 Graph Model Tags 49
stackBarPolicy The stackBarPolicy attribute enables you to define whether or not the data elements are stacked or sit side-by-side on the bar chart. There are three valid values: Automatic, True, and False. The Automatic setting by default stacks a subgrouped chart but not a multiple response chart. The True setting stacks responses or subgroups, whereas the False setting does not stack either. However, if both multiple responses and subgroups are defined, the resulting graph produces stacked subgroups, but does not stack multiple responses.
Value set to Automatic
Value set to True
Valid values: Automatic True False
Value set to False
50 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
Note: Only bars associated with the same response axis will stack. Those graphs using barResponseVariable and barResponse2Variable attributes will not stack. You can, however, define multiple response variables on a single axis using two AnalysisVariableList objects with the barResponseVariable and barResponse2Variable attributes. <sas:BarChartModel stackBarPolicy="True" >
3.2 BarLineChartModel The sas:BarLineChartModel tag can be nested only within a sas:BarLineChart tag to help define the look and feel of a combination bar and line chart. Here is how the syntax might look at the appropriate nested level: <sas:BarLineChart > <sas:BarLineChartModel >
antialiasedGraphics The antialiasedGraphics attribute of the BarLineChartModel smooths the edges when set to True, which is the default. In some system environments, the difference is insignificant. For this reason, we do not provide an example of the output for any of the antialiased attributes. Valid values: Boolean (True/False) <sas:BarLineChartModel antialiasedGraphics="True">
antialiasedText Similar to the antialiasedGraphics attribute, the antialiasedText attribute smooths the edges of text in the output. The default value is True. Valid values: Boolean (True/False)
Chapter 3: SAS AppDev Studio 3 Graph Model Tags 51
<sas:BarLineChartModel antialiasedText="True">
barShape You can change the shape used to represent the bar using the barShape attribute. Currently only two shapes are available: a rectangle (which is the default) and a cylinder. These shapes are displayed only when the dimension attribute of the graph is set to 3D. This example shows the barShape attribute with a setting of Cylinder. Valid values: Rectangle Cylinder Requirements: dimension=“3D”
<sas:BarLineChartModel barShape="Cylinder" dimension="3d">
52 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
barWidth You can use the barWidth attribute to set the display property of the bars in the bar chart. Valid values: <Measure> The <Measure> value can be px (pixels), pt (points), cm (centimeters), or in (inches). Examples of valid values: 50px, 3cm, 1in Requirements: growBarWidthEnabled=“true”
<sas:BarLineChartModel barWidth="100pt" growBarWidthEnabled="true">
Chapter 3: SAS AppDev Studio 3 Graph Model Tags 53
barWidthSpace To set the width of the white space around each bar, you can use the barWidthSpace attribute. Valid values: <Measure> The <Measure> value can be px (pixels), pt (points), cm (centimeters), or in (inches). Examples of valid values: 50px, 3cm, 1in
<sas:BarLineChartModel barWidthSpace="100pt">
54 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
dimension To set the aspect to 3D, you can use the dimension attribute. The default is 2D. The example shows a threedimensional graph. Valid values: 2D 3D
<sas:BarLineChartModel dimension="3d">
Note: The dimension attribute reverts back to 2D if the number of bars cannot be easily displayed using the defined width of the chart.
fillAreaEnabled The fillAreaEnabled attribute enables you to fill the area between the line and the axis. The default value is False. The bar line chart shown has the value set to True. Valid values: Boolean (True/False)
<sas:BarLineChartModel fillAreaEnabled="True">
Chapter 3: SAS AppDev Studio 3 Graph Model Tags 55
Note: When the fillAreaEnabled attribute is set to False, the line appears in front of the bars, as shown in the previous example.
insideBarLabelContent The insideBarLabelContent attribute enables you to set up the type of information to be displayed inside the bar. This example shows the insideBarLabelContent attribute set to Percent. Valid values: Automatic None Category Response Sum Mean Percent Subpercent
<sas:BarLineChart id="insideBarLabelContent_SASBarLineChart" model="blcTDMFitness3" scope="session" appliedColorSchemeName="Carnival"> <sas:BarLineChartModel insideBarLabelContent="Percent">
Note: The reason we have used the appliedColorSchemeName attribute here is that the default text color for the label content was too dark on an already dark bar (blue). We changed to a lighter color scheme so that the text would show up better.
56 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
markerEnabled The markerEnabled attribute controls whether markers are displayed or not. The default value is True, to show the markers. The attribute in this example is set to False. Valid values: Boolean (True/False)
<sas:BarLineChartModel markerEnabled="False">
missingPolicy The missingPolicy attribute sets the behavior of the graph for displaying missing values. There are three values: Automatic, True, and False. The Automatic setting displays all missing values for classification variables except those for category variables. The True setting displays all missing values, whereas the False setting does not display any missing values for classification variables. The following graph shows this attribute set to True.
Chapter 3: SAS AppDev Studio 3 Graph Model Tags 57
Valid values: Automatic True False <sas:BarLineChartModel missingPolicy="true">
outsideBarLabelContent Similar to the insideBarLabelContent attribute, the outsideBarLabelContent attribute enables you to set data to be displayed just outside of each bar. The outsideBarLabelContent attribute is set to Percent in this example. Valid values: Automatic None Category Response Sum Mean Percent
<sas:BarLineChartModel outsideBarLabelContent="Percent" >
58 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
outsideMarkerLabelContent The outsideMarkerLabelContent attribute sets the data information to be displayed above the markers. The value of the outsideMarkerLabelContent attribute in this example is Percent. Valid values: Automatic None Category Response Sum Mean Percent <sas:BarLineChart id="outsideMarkerLabelContent_SASBarLineChart" model="blcTDMFitness3" scope="session" appliedColorSchemeName="Carnival"> <sas:BarLineChartModel outsideMarkerLabelContent="Percent" >
response2AxisLowerThreshold To set a low threshold value on the response2 axis, use the response2AxisLowerThreshold attribute. This attribute enables you to earmark those values that may negatively exceed an expected amount below the baseline.
Chapter 3: SAS AppDev Studio 3 Graph Model Tags 59
Valid values: <sas:BarLineChartModel response2AxisLowerThreshold="-10.0" >
response2AxisUpperThreshold You can also set an upper threshold to the response2 axis by using the response2AxisUpperThreshold attribute. The upper threshold must be greater than the baseline value.
Valid values: <sas:BarLineChartModel response2AxisUpperThreshold="12.0" >
60 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
responseAxisLowerThreshold To set a low threshold value on the response axis, use the responseAxisLowerThreshold attribute. This attribute enables you to earmark those values that may negatively exceed an expected amount below the baseline.
Valid values: <sas:BarLineChartModel responseAxisLowerThreshold="-15.0" >
responseAxisUpperThreshold You can also set a upper threshold to the response axis by using the responseAxisUpperThreshold attribute. The upper threshold must be greater than the baseline value.
Valid values:
Chapter 3: SAS AppDev Studio 3 Graph Model Tags 61
<sas:BarLineChartModel responseAxisUpperThreshold="6.0">
stackBarPolicy The stackBarPolicy attribute enables you to define whether or not the data elements are stacked or sit side-by-side on the bar chart. There are three valid values: Automatic, True, and False. The Automatic setting by default stacks a subgrouped chart but not a multiple response chart. The True setting stacks responses or subgroups, whereas the False setting does not stack either. However, if both multiple responses and subgroups are defined, the resulting graph produces stacked subgroups, but does not stack multiple responses.
Note: For clarity we have removed the Line Response references.
62 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
Note: Only bars associated with the same response axis will stack. Those graphs using barResponseVariable and barResponse2Variable attributes will not stack. You can, however, define multiple response variables on a single axis using two AnalysisVariableList objects with the barResponseVariable and barResponse2Variable attributes. Valid values: Automatic True False <sas:BarLineChartModel stackBarPolicy="True">
Chapter 3: SAS AppDev Studio 3 Graph Model Tags 63
stackLinePolicy Like the stackBarPolicy attribute, the stackLinePolicy attribute determines whether to display the output as stacks or not. Although defined in the Help files and online, this attribute was not fully functional at the time of this writing.
zeroHeightBarsVisible The zeroHeightBarsVisible attribute sets the display to show or hide those bars with a zero height. The default value is False. The first example illustrates the value set to True. The second example shows it set to False.
Valid values: Boolean (True/False) <sas:BarLineChartModel zeroHeightBarsVisible="true" >
64 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
3.3 LineChartModel The sas:LineChartModel tag can be nested only within a sas:LineChart tag to help define the look and feel of a line chart. Here is how the syntax might look at the appropriate nested level: <sas:LineChart > <sas:LineChartModel >
antialiasedGraphics The antialiasedGraphics attribute of the LineChartModel tag smooths the edges when set to True, which is the default. In some system environments, the difference is insignificant. For this reason, we do not provide an example of the output for any of the antialiased attributes. Valid values: Boolean (True/False) <sas:LineChartModel antialiasedGraphics="true" >
antialiasedText Similar to the antialiasedGraphics attribute, the antialiasedText attribute smooths the edges of text in the output. The default value is True. Valid values: Boolean (True/False) <sas:LineChartModel antialiasedText="true" >
Chapter 3: SAS AppDev Studio 3 Graph Model Tags 65
fillAreaEnabled The fillAreaEnabled attribute enables you to fill the area between the line and the axis. The default value is False. In this example, we have set this to True. Valid values: Boolean (True/False)
<sas:LineChartModel fillAreaEnabled="True">
markerEnabled The markerEnabled attribute controls whether markers are displayed or not. The default value is True, to show the markers. Here we have set it to False. Valid values: Boolean (True/False)
<sas:LineChartModel markerEnabled="False">
66 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
missingPolicy The missingPolicy attribute sets the behavior of the graph for displaying missing values. There are three values: Automatic, True, and False. The Automatic setting displays all missing values for classification variables except those for category variables. The True setting displays all missing values, whereas the False setting does not display any missing values for classification variables. This example shows the attribute set to True. Valid values: Automatic True False
<sas:LineChartModel missingPolicy="true" >
outsideMarkerLabelContent The outsideMarkerLabelContent attribute sets the data information to be displayed above the markers. The value of the outsideMarkerLabelContent attribute in this example is Percent. Valid values: Automatic None Category Response Sum Mean Percent
Chapter 3: SAS AppDev Studio 3 Graph Model Tags 67
<sas:LineChartModel outsideMarkerLabelContent="Percent">
stackLinePolicy Like the stackBarPolicy attribute, the stackLinePolicy attribute determines whether to display the output as stacks or not. (This attribute did not function with the tested release.)
3.3.1 Response Axis Thresholds To set a low threshold value on the response2 axis, use the response2AxisLowerThreshold attribute. This allows you to earmark those values that may negatively exceed an expected amount below the baseline. You can also set a upper threshold to the response2 axis by using the response2AxisUpperThreshold attribute. The upper threshold must be greater than the baseline value. To set a low threshold value on the response axis, use the responseAxisLowerThreshold attribute. This attribute allows you to earmark those values that may negatively exceed an expected amount below the baseline. You can also set a upper threshold to the response axis by using the responseAxisUpperThreshold attribute. The upper threshold must be greater than the baseline value. (None of these attributes functioned with the tested release.)
3.4 LinePlotModel The sas:LinePlotModel tag can be nested only within a sas:LinePlot tag to help define the look and feel of a line plot. Here is how the syntax might look at the appropriate nested level: <sas:LinePlot > <sas:LinePlotModel >
68 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
antialiasedGraphics The antialiasedGraphics attribute of the LinePlotModel smooths the edges when set to True, which is the default. In some system environments, the difference is insignificant. For this reason, we do not provide an example of the output for any of the antialiased attributes. Valid values: Boolean (True/False) <sas:LinePlotModel antialiasedGraphics="true" >
antialiasedText Similar to the antialiasedGraphics attribute, the antialiasedText attribute smooths the edges of text in the output. The default value is True. Valid values: Boolean (True/False) <sas:LinePlotModel antialiasedText="true" >
bottomMarkerLabelContent The bottomMarkerLabelContent attribute enables you to set the type of content to display below the markers. There are four valid values: Automatic, which displays the bottomMarkerVariable if it is defined in the tableDataModel; None, which displays nothing; X, which displays the data along the x axis; and Y, which displays the data along the y or y2 axis.
Chapter 3: SAS AppDev Studio 3 Graph Model Tags 69
Set to X.
Set to Y.
Valid values: Automatic None X Y
<sas:LinePlotModel bottomMarkerLabelContent="X" >
fillAreaEnabled The fillAreaEnabled attribute enables you to fill the area between the line and the axis. The default value is False. This example shows the value set to True. Valid values: Boolean (True/False)
70 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
<sas:LinePlotModel fillAreaEnabled="true" >
interpolationEnabled The interpolationEnabled attribute sets the display property of interpolation among the markers. The default value is True. This example demonstrates a False value. Valid values: Boolean (True/False)
<sas:LinePlotModel interpolationEnabled="false" >
markerEnabled The markerEnabled attribute controls whether markers are displayed or not. The default value is True, to show the markers. The attribute in this example is set to False. Valid values: Boolean (True/False)
<sas:LinePlotModel markerEnabled="false" >
Chapter 3: SAS AppDev Studio 3 Graph Model Tags 71
matchErrorColor The matchErrorColor attribute sets the error markers to use the same color as the error lines. The default value is False. (This attribute did not function with the tested release.)
matchMarkerLabelColor The matchMarkerLabelColor attribute sets the marker labels to use the same color as the markers themselves. The default value is False. So that the model knows what to match to the marker label, you must also set a marker label content using the bottomMarkerLabelContent or topMarkerLabelContent attributes. This example shows the value set to True using the bottomMarkerLabelContent of X. Valid values: Boolean (True/false) Requirements: bottomMarkerLabelContent=“” or topMarkerLabelContent=“” and the nested sas:BottomMarkerLabelTextStyle or sas:TopMarkerLabelTextStyle tag
<sas:LinePlotModel matchMarkerLabelColor="true" bottomMarkerLabelContent="X" >
72 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
matchNeedleColor The matchNeedleColor attribute sets the color of the needles to be the same as the color for the markers. The default value is False. This example shows the value set to True. Valid values: Boolean (True/False) Requirements: You need to nest a sas:DataElementStyles tag and define a sas:MarkerStyle tag to use interpolation=“”
<sas:LinePlotModel matchNeedleColor="true" > <sas:DataElementStyles > <sas:MarkerStyle interpolation="VerticalNeedles" >
skipMissing If there are missing values, you can skip these data points by setting the skipMissing attribute to True. By default this attribute is set to True.
Chapter 3: SAS AppDev Studio 3 Graph Model Tags 73
Set to False, which causes a visible break in the data.
Set to True, which skips over the missing data.
Valid values: Boolean (True/False) <sas:LinePlotModel skipMissing="true" >
topMarkerLabelContent The topMarkerLabelContent attribute enables you to set the type of content to display above the markers. There are four valid values: Automatic, which displays the topMarkerVariable if it is defined in the tableDataModel; None, which displays nothing; X, which displays the data along the x axis; and Y, which displays the data along the y or y2 axis.
Set to X.
Set to Y.
74 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
Valid values: Automatic None X Y Requirements: sas:TopMarkerLabelTextStyle <sas:LinePlotModel topMarkerLabelContent="X" > <sas:TopMarkerLabelTextStyle />
3.4.1 Axis Baselines The baseline anchor position for the x axis can be defined using the xAxisBaseline attribute. The baseline anchor position for the y2 axis can be defined using the y2AxisBaseline attribute. The baseline anchor position for the y axis can be defined using the yAxisBaseline attribute. (None of these attributes functioned with the tested release.)
3.5 PieChartModel The sas:PieChartModel tag can be nested only within a sas:PieChart tag to help define the look and feel of a pie or donut chart. Here is how the syntax might look at the appropriate nested level: <sas:PieChart > <sas:PieChartModel >
Chapter 3: SAS AppDev Studio 3 Graph Model Tags 75
across The across attribute enables you to set the number of pies to display horizontally when there are multiple responses. Valid values:
<sas:PieChartModel across="1" >
antialiasedGraphics The antialiasedGraphics attribute of the PieChartModel smooths the edges when set to True, which is the default. In some system environments, the difference is insignificant. For this reason, we do not provide an example of the output for any of the antialiased attributes. Valid values: Boolean (True/False)
76 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
<sas:PieChartModel antialiasedGraphics="true" >
antialiasedText Similar to the antialiasedGraphics attribute, the antialiasedText attribute smooths the edges of text in the output. The default value is True. Valid values: Boolean (True/False) <sas:PieChartModel antialiasedText="true" >
dimension To set the aspect to 3D, you can use the dimension attribute. The default is 2D. The graph shows the dimension attribute set to 3D. Valid values: 2D 3D
<sas:PieChartModel dimension="3D">
Chapter 3: SAS AppDev Studio 3 Graph Model Tags 77
donutHoleLabel The donutHoleLabel attribute enables you to define a label that will be centered in the pie. The example sets the donut hole size to accommodate the length of the label. Valid values: <String>
<sas:PieChartModel donutHoleLabel="Donut Hole Label" donutHoleSize=”75”>
donutHoleSize The donutHoleSize attribute sets up the size of the open area in the center of the pie (the “donut hole”). This value represents the percentage of the size of the radius of the whole pie. So by specifying 25, you are telling the donut hole to have a radius that is 25% of the radius of the whole pie. The example demonstrates the use of this value. Valid values:
78 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
<sas:PieChartModel donutHoleSize="25">
down The down attribute enables you to set the number of pies to display vertically when there are multiple responses.
Valid values: <sas:PieChartModel down="1" >
Chapter 3: SAS AppDev Studio 3 Graph Model Tags 79
explodedCategories The explodedCategories attribute allows you to set apart (or “explode”) a specified category. The effect looks as though someone pulled out a particular slice or slices from the pie. This attribute is ignored in a pie with subgroups. The following example pulls out the category representing Canada. Valid values: <String> (The string should represent a valid category in the data.)
<sas:PieChartModel explodedCategories="Canada">
insideSliceLabelContent To set up data content to be displayed in the pie slices, you can use the insideSliceLabelContent attribute. The insideSliceLabelContent attribute is set to Percent in this example. Valid values: Automatic None Category Response Percent CategoryResponse CategoryPercent ResponsePercent CategoryResponsePercent
80 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
<sas:PieChartModel insideSliceLabelContent="Percent">
insideSliceLabelPlacement The insideSliceLabelPlacement attribute is to be used with the insideSliceLabelContent attribute. This attribute enables you to set the placement of the displayed values. There are two valid values: Automatic, which forces all content to display; and Best, which may or may not place content on each slice, depending on the amount of space in the slice. Valid values: Automatic Best Requirements: insideSliceLabelContent=“” Note: In this example, we are using Best, and in the output the slice representing Australia does not display the content. This is because there is not enough room inside the label to display the content correctly. <sas:PieChartModel insideSliceLabelContent="Percent" insideSliceLabelPlacement="Best" >
Chapter 3: SAS AppDev Studio 3 Graph Model Tags 81
invisibleCategories If you have ever wanted to focus in on just a few categories of data instead of everything, you are in luck. You can use the invisibleCategories attribute to tell the pie to omit specified categories. Valid values: <String> (The string should represent a valid category in the data.)
<sas:PieChartModel invisibleCategories="Canada">
missingPolicy The missingPolicy attribute sets the behavior of the graph for displaying missing values. There are three values: Automatic, True, and False. The Automatic setting displays all missing values for classification variables except those for category variables. The True setting displays all missing values, whereas the False setting does not display any missing values for classification variables. This example shows this attribute set to True. Valid values: Automatic True False
82 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
<sas:PieChartModel missingPolicy="true" >
otherColor The otherColor attribute sets the color to be used for the group defined by the otherThreshold value. (This attribute did not function with the tested release.)
otherSliceLabel Although the otherColor attribute is not currently working, you can set the label of the other slice in the pie using the otherSliceLabel attribute. This attribute can be used when defining the otherThreshold attribute to create a userdefined “Other” category, or by default when a slice is small enough to be below the default threshold. Valid values: <String>
<sas:PieChartModel otherSliceLabel="Other Slice Label" otherThreshold="40.0" >
Chapter 3: SAS AppDev Studio 3 Graph Model Tags 83
otherThreshold The otherThreshold attribute sets the upper threshold limit for combining slices. This is useful when you have several smaller slices that you might want to combine into a bucket. The threshold is currently based only on percentage values. For example, if you have three slices and they occupy 50, 35 and 15 percent of the pie, then you specify the otherThreshold attribute to be equal to 40. You will see only 2 slices, with the 50% slice labeled with its corresponding category label and the other slice labeled by default with “Other”, unless otherwise specified with otherSliceLabel. Valid values:
<sas:PieChartModel otherThreshold="40.0">
outsideSliceLabelContent To set data content to be displayed outside the pie slices, you can use the outsideSliceLabelContent attribute. This example shows the attribute set to Percent. Valid values: Automatic None Category Response Percent CategoryResponse CategoryPercent ResponsePercent CategoryResponsePercent
84 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
<sas:PieChartModel outsideSliceLabelContent="Percent">
outsideSliceLabelPlacement The outsideSliceLabelPlacement attribute is used with the outsideSliceLabelContent attribute. This attribute enables you to set the placement of the displayed values. There are two valid values: Automatic, which forces all content to display; and Arrow, which offsets the content values and places arrows pointing to the slice it represents. This example shows the value set to Arrow. Valid values: Automatic Arrow Requirements: outsideSliceLabelContent=“”
<sas:PieChartModel outsideSliceLabelContent="Percent" outsideSliceLabelPlacement="Arrow" >
Chapter 3: SAS AppDev Studio 3 Graph Model Tags 85
responseLabelVisiblePolicy The responseLabelVisiblePolicy attribute controls whether response labels are shown or not shown. In the first graph, this attribute has a value of True, whereas the value in the second one is False. Note that the first graph, with a value of True, shows the label “AMOUNT.” In the second graph, “AMOUNT” does not show. Valid values: Boolean (True/False)
<sas:PieChartModel responseLabelVisiblePolicy="True">
86 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
reverseDirection The reverseDirection attribute sets the slices to be displayed in a counterclockwise direction if set to True. The clockwise direction is the default. Valid values: Boolean (True/False)
<sas:PieChartModel reverseDirection="true">
sliceOrder The sliceOrder attribute enables you to set the ordering of the slices based on the data. There are three valid values for this attribute: None, which displays the slices in the order that they are in within the data; Ascending, which sorts and displays the data in an ascending order; and Descending, which sorts and displays the data in a descending order. This example shows values in descending order. Valid values: None Ascending Descending
Chapter 3: SAS AppDev Studio 3 Graph Model Tags 87
<sas:PieChartModel sliceOrder="descending">
startAngle The startAngle attribute sets the angle, in degrees, at which the pie should start the first slice. By default, the 3 o’clock position is set at 0 degrees. Therefore, if you set the startAngle attribute at 90, the pie slices start at the top of the pie. Valid values:
<sas:PieChartModel startAngle="50">
3.6 RadarChartModel The sas:RadarChartModel tag can be nested only within a sas:RadarChart tag to help define the look and feel of a radar chart.
88 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
Here is how the syntax might look at the appropriate nested level: <sas:RadarChart > <sas:RadarChartModel >
antialiasedGraphics The antialiasedGraphics attribute of the RadarChartModel smooths the edges when set to True, which is the default. In some system environments, the difference is insignificant. For this reason, we do not provide an example of the output for any of the antialiased attributes. Valid values: Boolean (True/False) <sas:RadarChartModel antialiasedGraphics="true" >
antialiasedText Similar to the antialiasedGraphics attribute, the antialiasedText attribute smooths the edges of text in the output. The default value is True. Valid values: Boolean (True/False) <sas:RadarChartModel antialiasedText="true" >
filledRadar The filledRadar attribute sets up the radar chart to be filled or unfilled.
Chapter 3: SAS AppDev Studio 3 Graph Model Tags 89
Set to True.
Set to False.
Valid values: Boolean (True/False) Note: In our example, if we set this to False, the values are not displayed at all. <sas:RadarChartModel filledRadar="false" >
missingPolicy The missingPolicy attribute sets the behavior of the graph for displaying missing values. There are three values: Automatic, True, and False. The Automatic setting displays all missing values for classification variables except those for category variables. The True setting displays all missing values, whereas the False setting does not display any missing values for classification variables.
Set to True
Set to False
90 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
Valid values: Boolean (True/False) <sas:RadarChartModel missingPolicy="true" >
radarType The radarType attribute enables you to set the output type for the radar chart. The default value is Wedge.
Set to Wedge.
Set to Polygon.
Set to Spoke.
Set to Radial.
Valid values: Wedge Polygon Spoke Radial <sas:RadarChartModel radarType="polygon" >
Chapter 3: SAS AppDev Studio 3 Graph Model Tags 91
startAngle The startAngle attribute enables you to set the angle at which you would like to put the first axis on the radar chart. The 12 o’clock position represents 0 degrees, and the axis points move clockwise. Valid values:
<sas:RadarChartModel startAngle="50">
uniformAxes The uniformAxes attribute controls whether or not the axes represent the same range.
Set to true.
Set to false.
Valid values: Boolean (True/False) <sas:RadarChartModel uniformAxes="true" >
92 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
3.7 ScatterPlotModel The sas:ScatterPlotModel tag can be nested only within a sas:ScatterPlot tag to help define the look and feel of a scatter plot. Here is how the syntax might look at the appropriate nested level: <sas:ScatterPlot > <sas:ScatterPlotModel >
antialiasedGraphics The antialiasedGraphics attribute of the ScatterPlotModel smooths the edges when set to True, which is the default. In some system environments, the difference is insignificant. For this reason, we do not provide an example of the output for any of the antialiased attributes. Valid values: Boolean (True/False) <sas:ScatterPlotModel antialiasedGraphics="true" >
antialiasedText Similar to the antialiasedGraphics attribute, the antialiasedText attribute smooths the edges of text in the output. The default value is True. Valid values: Boolean (True/False) <sas:ScatterPlotModel antialiasedText="true" >
bottomMarkerLabelContent The bottomMarkerLabelContent attribute enables you to set the type of content to display below the markers. There are four valid values: Automatic, which displays the bottomMarkerVariable if it is defined in the tableDataModel; None, which displays nothing; X, which displays the data along the x axis; and Y, which displays the data along the y or y2 axis.
Chapter 3: SAS AppDev Studio 3 Graph Model Tags 93
(This attribute did not function with the tested release.)
fillAreaEnabled The fillAreaEnabled attribute enables you to fill the area between the line and the axis. The default value is False. The example shows the value set to True.
Valid values: Boolean (True/False) <sas:ScatterPlotModel fillAreaEnabled="true" >
interpolationEnabled The interpolationEnabled attribute sets the display property of interpolation among the markers. The default value is set to True. In the first graph shown, the attribute has a value of True, whereas the value in second one is False.
94 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
Valid values: Boolean (True/False) <sas:ScatterPlotModel interpolationEnabled="true" >
markerEnabled The markerEnabled attribute controls whether markers are displayed or not. The default value is True, to show the markers. The attribute in this example is set to False. Valid values: Boolean (True/False)
<sas:ScatterPlotModel markerEnabled="false" >
Chapter 3: SAS AppDev Studio 3 Graph Model Tags 95
matchErrorColor The matchErrorColor attribute sets the error markers to use the same color as the error lines. The default value is False. (This attribute did not function with the tested release.)
maxMarkerSize The maxMarkerSize attribute sets the maximum size of the displayed markers. (This attribute did not function with the tested release.)
minMarkerSize The minMarkerSize attribute sets the minimum size of the displayed markers. (This attribute did not function with the tested release.)
skipMissing If there are missing values, you can skip these data points by setting the skipMissing attribute to True. By default this attribute is set to True. To show this more distinctively, we have also included the interpolationEnabled attribute and set it to True. Valid values: Boolean (True/False)
<sas:ScatterPlotModel skipMissing="true" interpolationEnabled="true" >
96 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
topMarkerLabelContent The topMarkerLabelContent attribute enables you to set the type of content to display above the markers. There are four valid values: Automatic, which displays the topMarkerVariable if it is defined in the tableDataModel; None, which displays nothing; X, which displays the data along the x axis; and Y, which displays the data along the y or y2 axis. To enable this display, you also need to specify the use of the sas:TopMarkerLabelTextStyle tag. Notice in the example code that we did not need to set any attributes for this tag. It is enough that it is there.
Set to X
Set to Y
Valid values: Automatic None X Y
Chapter 3: SAS AppDev Studio 3 Graph Model Tags 97
Requirements: sas:TopMarkerLabelTextStyle <sas:ScatterPlotModel topMarkerLabelContent="X" > <sas:TopMarkerLabelTextStyle />
3.7.1 Baselines The baseline anchor position for the x axis can be defined using the xBaseline attribute. The baseline anchor position for the y2 axis can be defined using the y2Baseline attribute. The baseline anchor position for the y axis can be defined using the yBaseline attribute. (None of these attributes functioned with the tested release.)
98 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
C h a p t e r
4
Nested Tags for Graph Models 4.1 Axis Models 100 4.1.1 Response Axis Baseline Models 107 4.1.2 Corresponding Graph Models 108 4.1.3 Column and Row Axis Models 110 4.2 Legends 111 4.2.1 Corresponding Graph Models 113 4.3 Line Style Tags 113 4.3.1 Corresponding Graph Models 116 4.4 Text Style Tags 116 4.4.1 Corresponding Graph Models 117 4.5 AxisWallModel 118 4.6 BackgroundFillStyle 119 4.6.1 Corresponding Graph Models 122 4.7 DataElementStyle 123 4.8 DataTipModel 123 4.9 SubgroupLabelModel 124
100 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
The following tags and their corresponding attributes are found in many of the upperlevel graph models. Where applicable, we show a screen shot of the output so you can see the effect of the referenced nested tag’s attribute. Nested tags can be used at various levels. However, these particular tags are found at the third level, similar to the following. <sas:BarChart > <sas:BarChartModel > <sas:ResponseAxisModel />
Each section also gives you information about which graphs accept which nested tag.
4.1 Axis Models Axis models have attributes that affect the tick marks, offsets, grid, categories, and direction of the graph. These seven axis models can be nested within several of the graph models: AxisModel, CategoryAxisModel, Response2AxisModel, ResponseAxisModel, XAxisModel, Y2AxisModel and YAxisModel. The following is a description of their attributes with corresponding examples.
categories The categories attribute sets the midpoint labels displayed on a noncontinuous axis. Valid values must be in the form of a string, but can contain more than one value. (This attribute did not function with the tested release.)
Chapter 4: Nested Tags for Graph Models 101
continuousMajorTickAnchor You can set the anchored location for the major tick marks on the axis by using the continuousMajorTickAnchor attribute. This attribute must be used with the attribute setting continuousMajorTickPositionPolicy= “AnchoredInterval”. Valid values: (This should be some number within or just outside the range of valid data values.) Requirement: continuousMajorTickPositionPolicy= “AnchoredInterval” <sas:ResponseAxisModel continuousMajorTickAnchor="50000" continuousMajorTickPositionPolicy="AnchoredInterval" continuousMajorTickInterval="100000" />
continuousMajorTickCount The continuousMajorTickCount attribute sets the number of major tick marks for the axis. This attribute must be used with the attribute setting continuousMajorTickPositionPolicy= “Count”. Valid values: Requirements: continuousMajorTickPositionPolicy= “Count”
<sas:ResponseAxisModel continuousMajorTickCount="10" continuousMajorTickPositionPolicy="Count" />
102 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
continuousMajorTickInterval The continuousMajorTickInterval attribute sets the interval value for major tick marks. This attribute must be used with the attribute setting continuousMajorTickPositionPolicy= “Interval” or continuousMajorTickPositionPolicy= “AnchoredInterval”. Valid values: Requirements: continuousMajorTickPositionPolicy= “Interval” or continuousMajorTickPositionPolicy= “AnchoredInterval”
<sas:ResponseAxisModel continuousMajorTickInterval="35000.0" continuousMajorTickPositionPolicy="Interval" />
continuousMajorTickPositionPolicy The continuousMajorTickPositionPolicy attribute sets the placement policy for major tick marks. This attribute is used in conjuction with some of the other continuous attributes. We’ve included the specifics and examples in the sections that discuss these attributes. Valid values: Default Count Interval AnchoredInterval UserDefined
Chapter 4: Nested Tags for Graph Models 103
continuousMajorTickValues To define your own placement of major tick marks, use the continuousMajorTickValues attribute in conjuction with the continuousMajorTickPositionPolicy= “UserDefined” statement. This will then enable you to define every one of the major tick marks on that axis. Valid values: Requirements: continuousMajorTickPositionPolicy= “UserDefined”
<sas:ResponseAxisModel continuousMajorTickValues="250000 400000" continuousMajorTickPositionPolicy="UserDefined" />
continuousMinorTickCount The continuousMinorTickCount attribute enables you to define how many minor tick marks exist between each major tick mark pair. The default value is 4. Valid values:
<sas:ResponseAxisModel continuousMinorTickCount="2" />
104 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
endOffset To set the length of offset of the graph area from the last major tick mark to the end of the axis line, use the endOffset attribute. Valid values: <Measure> The <Measure> value can be px (pixels), pt (points), cm (centimeters), or in (inches). Examples of valid values: 50px, 3cm, 1in <sas:ResponseAxisModel endOffset="50px" />
gridInFront The gridInFront attribute sets the grid lines in the front or the back of the graph. Note that you need to use this attribute in combination with the nested GridLineStyle tag. Otherwise, on a two-dimensional graph the grids will not display.
Set to True
Set to False
Chapter 4: Nested Tags for Graph Models 105
Valid values: Boolean (True/False) Requirements sas:GridLineStyle <sas:ResponseAxisModel gridInFront="true" > <sas:GridLineStyle id="newgrid" visibilityPolicy="true"/>
label The label attribute overrides the current label for the axis. Valid values: <String>
Note: The label output is cut off. Be careful with how long your strings are, because they may not fit in the graph area. <sas:AxisModel label="AxisModel Label">
majorTickTimeInterval The majorTickTimeInterval attribute helps to specify the time intervals to show on the axis. (This attribute did not function with the tested release.)
106 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
reverseDirection The reverseDirection attribute enables you to reverse the direction of the axis, thereby changing the overall appearance of the data points. In this example, the value is set to True. Valid values: Boolean (True/False)
<sas:ResponseAxisModel reverseDirection="true" />
startOffset To set the length of offset of the graph area from the first major tick mark to the beginning of the axis line, use the startOffset attribute. Valid values: <Measure> The <Measure> value can be px (pixels), pt (points), cm (centimeters), or in (inches). Examples of valid values: 50px, 3cm, 1in <sas:ResponseAxisModel startOffset="50px" />
Chapter 4: Nested Tags for Graph Models 107
4.1.1 Response Axis Baseline Models There are two more tags that affect axes: Response2AxisBaselineModel and ResponseAxisBaselineModel. These tags enable you to adjust the look and feel of the base reference line. Each has a common set of attributes, but they are not used in the same way. These tags are modeled after the ReferenceLineModel tag discussed in Chapter 5, “Supporting Tags.”
inFront The inFront attribute enables you to define whether or not the response baselines should be presented in front of the chart or in the background. If you look closely, you will see in the graph below that inFront is set to True.
Valid values: Boolean (True/False) <sas:ResponseAxisBaselineModel inFront="true" label="Goal" labelPlacement="outside" position="250000.0" visible="true" />
108 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
position The position attribute enables you to place the baseline on the chart. Valid values:
<sas:ResponseAxisBaselineModel inFront="true" label="Goal" labelPlacement="outside" position="250000.0" visible="true" />
4.1.2 Corresponding Graph Models Not all seven axis models (AxisModel, CategoryAxisModel, Response2AxisModel, ResponseAxisModel, XAxisModel, Y2AxisModel, and YAxisModel) work with all chart models. These charts show which axis models you can use with the chart types.
AxisModel BarChartModel BarLineChartModel LineChartModel LinePlotModel PieChartModel RadarChartModel ScatterPlotModel
3
Chapter 4: Nested Tags for Graph Models 109
CategoryAxisModel BarChartModel BarLineChartModel LineChartModel
3 3 3
LinePlotModel PieChartModel RadarChartModel ScatterPlotModel
Response2AxisModel BarChartModel BarLineChartModel LineChartModel
3 3 3
LinePlotModel PieChartModel RadarChartModel ScatterPlotModel
ResponseAxisModel BarChartModel BarLineChartModel LineChartModel LinePlotModel PieChartModel RadarChartModel ScatterPlotModel
3 3 3
110 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
XAxisModel BarChartModel BarLineChartModel LineChartModel LinePlotModel
3
PieChartModel RadarChartModel ScatterPlotModel
3
Y2AxisModel BarChartModel BarLineChartModel LineChartModel LinePlotModel
3
PieChartModel RadarChartModel ScatterPlotModel
3
YAxisModel BarChartModel BarLineChartModel LineChartModel LinePlotModel
3
PieChartModel RadarChartModel ScatterPlotModel
3
4.1.3 Column and Row Axis Models The ColumnAxisModel and RowAxisModel tags do not have specific look and feel attributes. However, they have several nested tags that can be used. For examples and a list of these nested tags, see Chapter 5.
Chapter 4: Nested Tags for Graph Models 111
Column and row axis models are supported for use with the following graph models. BarChartModel BarLineChartModel LineChartModel LinePlotModel PieChartModel RadarChartModel ScatterPlotModel
3 3 3 3 3 3 3
4.2 Legends These legend model tags can be used with various graph models: ColorLegendModel, LegendModel, LineLegendModel, and ShapeLegendModel. They each share a common set of attributes and supporting tags.
label The label attribute sets a string to be the legend title. Valid values: <String>
<sas:LegendModel label="Legend Label" labelPlacement="Right" placement="West" visible="true" />
112 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
labelPlacement You can set the alignment of the label using the labelPlacement attribute. In this example, the labelPlacement attribute is set to Right. Valid values: Automatic Right Outside InsideLeft InsideRight AcrossCenter OutsideLeft OutsideRight
Left Inside Across InsideCenter AcrossLeft AcrossRight OutsideCenter
<sas:LegendModel label="Legend Label" labelPlacement="Right" placement="West" visible="true" />
placement You can use the placement attribute to position the legend in the graph space. In this example, the placement attribute is set to West. Valid values: Automatic North South East West
<sas:LegendModel label="Legend Label" labelPlacement="Right" placement="West" visible="true" />
Chapter 4: Nested Tags for Graph Models 113
4.2.1 Corresponding Graph Models You can use the following legend models with the following graph models. ColorLegendModel
3 3 3
BarChartModel BarLineChartModel LineChartModel LinePlotModel
3 3
PieChartModel RadarChartModel ScatterPlotModel
LegendModel
3 3 LineLegendModel
ShapeLegendModel
BarChartModel BarLineChartModel LineChartModel LinePlotModel
3
PieChartModel RadarChartModel ScatterPlotModel
3
4.3 Line Style Tags The FrameLineStyle and NeedleLineStyle tags are the two upper-level tags that help to define lines such as the frame around objects and the needles used with markers on plots. Note: The FrameLineStyle tag is also a supporting tag, because frames are used in multiple objects. The FrameLineStyle tag used with legends is at a different nesting level than the one used in this section, which is a component of the graph. This tag is discussed both here and in Chapter 5. The FrameLineStyle and NeedLineStyle tags each contain the following visual attributes.
114 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
color The color attribute defines the color to use for the line.
<sas:BarChart id="frameLineStyleAttributes" model="bcTDMGrains2" scope="session"> <sas:BarChartModel> <sas:FrameLineStyle color="red" thickness="3px" visibilityPolicy="true" />
Chapter 4: Nested Tags for Graph Models 115
<sas:LinePlot id="needleLineStyleAttributes" model="lpTDMPopData" scope="session" > <sas:LinePlotModel > <sas:DataElementStyles > <sas:MarkerStyle interpolation="VerticalNeedles" > <sas:NeedleLineStyle color="red" thickness="3px" visibilityPolicy="true" />
Valid values: <String> (This value can be any valid Java java.awt.Color or hexadecimal value representing a color.) Note: When you use the NeedleLineStyle you will also need to set the DataElementStyles of the line plot to use either of the interpolation types that use needles.
thickness You can define the line thickness using the thickness attribute. The previous examples and code illustrate the use of this attribute. Valid values: <Measure> The <Measure> value can be px (pixels), pt (points), cm (centimeters), or in (inches). Examples of valid values: 50px, 3cm, 1in
116 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
4.3.1 Corresponding Graph Models These line style tags can be used with the following graph models. FrameLineStyle
3 BarLineChartModel 3 LineChartModel 3 LinePlotModel 3 PieChartModel 3 RadarChartModel 3 ScatterPlotModel 3
NeedleLineStyle
BarChartModel
3
3
4.4 Text Style Tags Many nested tags support text styles: BottomMarkerLabelTextStyle, DonutHoleLabelTextStyle, InsideBarLabelTextStyle, InsideSliceLabelTextStyle, OutsideBarLabelTextStyle, OutsideMarkerLabelTextStyle, OutsideSliceLabelTextStyle, and TopMarkerLabelTextStyle. Each have the same common attributes. The following chart is an example of the use of all three attributes.
<sas:BottomMarkerLabelTextStyle baselineAngle="50.0" color="red" justification="right" visible="true" />
Chapter 4: Nested Tags for Graph Models 117
baselineAngle The baselineAngle attribute sets the angle at which the text should be displayed. The starting angle 0 is located at 3 o’clock. The text pivots around an anchor point. The anchor point may vary, depending on the type of graph, the display method, and other factors. Valid values:
color To set the color of the text use the color attribute. Valid values: <String> (This value can be any valid Java java.awt.Color.)
justification The justification attribute enables you to define the justification or alignment of the text. The default value is Left. Valid values: Left Right Center
4.4.1 Corresponding Graph Models These text style tags can be used with the following graph models. BottomMarkerLabelTextStyle
TopMarkerLabelTextStyle
LinePlotModel
3
3 3 3
PieChartModel RadarChartModel ScatterPlotModel
3
3
BarChartModel BarLineChartModel LineChartModel
118 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
BarChartModel BarLineChartModel
InsideBarLabelTextStyle
OutsideBarLabelTextStyle
3 3
3 3
InsideSliceLabelTextStyle
OutsideSliceLabelTextStyle
3
3
LineChartModel LinePlotModel PieChartModel RadarChartModel ScatterPlotModel
BarChartModel BarLineChartModel LineChartModel LinePlotModel PieChartModel RadarChartModel ScatterPlotModel
DonutHoleLabelTextStyle BarChartModel BarLineChartModel
3 3
LineChartModel LinePlotModel PieChartModel
OutsideMarkerLabelTextStyle
3
RadarChartModel ScatterPlotModel
4.5 AxisWallModel The AxisWallModel tag enables you to define certain visual properties of the axis wall with several chart types. This particular tag does not have specific attributes. Instead, it uses other supporting tags such as WallFillStyle and FloorFillStyle. See Chapter 5 for more information on these tags.
Chapter 4: Nested Tags for Graph Models 119
This tag can be used with the following graph models.
3 BarLineChartModel 3 LineChartModel 3 LinePlotModel 3 BarChartModel
PieChartModel RadarChartModel ScatterPlotModel
3 3
4.6 BackgroundFillStyle The BackgroundFillStyle tag enables you to define how to display the background of the graph area. This background can be a solid color or a gradient. This is another tag that can be used at several different levels. At this level it is used to describe the background of the graph area; however, in other circumstances it can also be used to describe the background of a legend. Therefore it can be reviewed twice, once here and once in the Chapter 5. The following attributes are associated with the BackgroundFillStyle tag.
fillType The fillType attribute sets the type of background. This example shows the fillType attribute set to Gradient. Valid values: SolidColor Gradient Image ImageColorBlend ImageGradientBlend
120 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
<sas:BackgroundFillStyle fillType="Gradient" gradientFillBeginColor="orange" gradientFillEndColor="white" gradientFill="DiagonalDown" />
gradientBlendBeginColor The gradientBlendBeginColor attribute sets the color to use as the starting color in a gradient. This is only applicable when used with fillType=“ImageGradientBlend”. (This attribute did not function with the tested release.)
gradientBlendEndColor The gradientBlendEndColor attribute, when used with fillType=“ImageGradientBlend”, defines the end color used in a gradient. (This attribute did not function with the tested release.)
gradientFillBeginColor The gradientFillBeginColor attribute sets the color to use as the starting color in a gradient. This is only applicable when used with fillType=“Gradient”. This example starts the gradient with red. Valid values: <String> (This value can be any valid Java java.awt.Color or hexadecimal value representing a color.) Requirements: fillType=“Gradient”
<sas:BackgroundFillStyle fillType="Gradient" gradientFillBeginColor="red" gradientFillEndColor="yellow" gradientFill="DiagonalDown" />
Chapter 4: Nested Tags for Graph Models 121
gradientFillEndColor The gradientFillEndColor attribute, when used with fillType=“Gradient”, defines the end color used in a gradient as shown in the previous example. Valid values: <String> (This value can be any valid Java java.awt.Color or hexadecimal value representing a color.) Requirements: fillType=“Gradient” <sas:BackgroundFillStyle fillType="Gradient" gradientFillBeginColor="red" gradientFillEndColor="yellow" gradientFill="DiagonalDown" />
gradientFill The gradientFill attribute sets the directional property for the gradient as shown in the previous example. Valid values: LeftToRight BottomToTop FrontToBack DiagonalUp DiagonalDown Requirements: fillType=“Gradient” <sas:BackgroundFillStyle fillType="Gradient" gradientFillBeginColor="red" gradientFillEndColor="yellow" gradientFill="DiagonalDown" />
imageFillColor The imageFillColor attribute sets the color used to fill the area before the image is applied. This attribute can be used only when the fillType attribute is defined using one of the image types. (This attribute did not function with the tested release.)
122 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
imageFill The imageFill attribute defines how to display the image specified and can be used only when the fillType attribute defines an image type. (This attribute did not function with the tested release.)
imageIcon The imageIcon attribute sets the image to use. This attribute can be used only when the fillType attribute is defined using one of the image types. (This attribute did not function with the tested release.)
solidBlendColor To define the color that is applied to the area after the image has been applied, use the solidBlendColor attribute. This attribute can be used only with fillType=“ImageColorBlend”. (This attribute did not function with the tested release.)
x The x attribute defines the x coordinate used with the image. (This attribute did not function with the tested release.)
y The y attribute defines the y coordinate used with the image. (This attribute did not function with the tested release.)
4.6.1 Corresponding Graph Models In general, only the solid color fills function correctly with the tested release. Just be aware of this when constructing your own graphs.
Chapter 4: Nested Tags for Graph Models 123
The BackgroundFillStyle can be used with the following graph models.
3 BarLineChartModel 3 LineChartModel 3 LinePlotModel 3 PieChartModel 3 RadarChartModel 3 ScatterPlotModel 3 BarChartModel
4.7 DataElementStyle You can use the DataElementStyle tag to adjust the data descriptions. This adjustment could apply to anything from bars to markers. The direct attributes of this tag do not seem to be working with the tested release; however, the supporting tags may. (This tag did not function with the tested release.)
4.8 DataTipModel The DataTipModel tag is used to adjust the visual elements of the data tip. (This tag did not function with the tested release.)
124 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
4.9 SubgroupLabelModel You can use the SubgroupLabelModel tag to describe the subgroup labels in a pie chart. There is only one attribute to be defined with this tag.
placement The placement attribute describes which side of the pie chart to display subgroup label information. This attribute is only applicable if there are subgroups. This example shows the value for placement set to West. Valid values: East West
<sas:SubgroupLabelModel placement="west" />
C h a p t e r
5
Supporting Tags 5.1 Fill Tags 126 5.2 Line Tags 130 5.2.1 AxisLineStyle, GridLinestyle, StrokeLineStyle, FrameLineStyle, and OutlineLineStyle 130 5.2.2 BasicStroke 133 5.3 Text Tags 133 5.3.1 Font 133 5.3.2 LabelTextStyle and ValueTextStyle 134 5.3.3 TextStyle 136 5.3.4 ShadowStyle 136 5.4 Tick Mark Tags 136 5.5 Miscellaneous Tags 137 5.5.1 DiscreteFillColor 137 5.5.2 MarkerStyle 137 5.5.3 ReferenceLineModel 141
126 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
Supporting tags are used in many places and support many other tags to further define the visual aspects of a graph. A good example is the sas:Font tag, which is not defined at the top level but is nested in almost every tag that supports text descriptions. <sas:BarChart id="fontAttributes" model="bcTDMGrains3" scope="session" > <sas:BarChartModel > <sas:LegendModel label="Legend Label" labelPlacement="Right" placement="West" visible="true"> <sas:LabelTextStyle > <sas:Font bold="true" family="Helvetica" size="14.0" />
Here we can see that the sas:Font tag is nested at the fifth level of this graph. Because these supporting tags are everywhere in the graph models, we do not provide a complete list of corresponding dependent tags here. See the SAS Custom Tag Reference in the Web Technologies Community pages at http://support.sas.com for more information on these tags.
5.1 Fill Tags Fill styles enable you to define how to display the background of the graph area. This background could be a solid color or a gradient. There are four main fill tags: BackgroundFillStyle, FillStyle, FloorFillStyle, and WallFillStyle The following are attributes associated with the fill style tags.
Chapter 5: Supporting Tags 127
fillType The fillType attribute sets the type of fill. This example shows the value of fillType set to Gradient. Valid values: SolidColor Gradient Image ImageColorBlend ImageGradientBlend
<sas:BackgroundFillStyle fillType="Gradient" gradientFillBeginColor="red" gradientFillEndColor="yellow" gradientFill="DiagonalDown" />
gradientBlendBeginColor The gradientBlendBeginColor attribute sets the color to use as the starting color in a gradient. This attribute is applicable only when used with fillType=“ImageGradientBlend”. (This attribute did not function with the tested release.)
gradientBlendEndColor The gradientBlendEndColor attribute, when used with fillType=“ImageGradientBlend”, defines the end color used in a gradient. (This attribute did not function with the tested release.)
128 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
gradientFillBeginColor The gradientFillBeginColor attribute sets the color to use as the starting color in a gradient. This attribute is applicable only when used with fillType=“Gradient”, as shown in the fillType example. Valid values: <String> (This value can be any valid Java java.awt.Color or hexadecimal value representing a color.) Requirements: fillType=“Gradient” <sas:BackgroundFillStyle fillType="Gradient" gradientFillBeginColor="red" gradientFillEndColor="yellow" gradientFill="DiagonalDown"/>
gradientFillEndColor The gradientFillEndColor attribute, when used with fillType=“Gradient”, defines the end color used in a gradient, as shown in the fillType example. Valid values: <String> (This value can be any valid Java java.awt.Color or hexadecimal value representing a color.) Requirements: fillType=“Gradient” <sas:BackgroundFillStyle fillType="Gradient" gradientFillBeginColor="red" gradientFillEndColor="yellow" gradientFill="DiagonalDown"/>
gradientFill The gradientFill attribute sets the directional property for the gradient, as shown in the fillType example. Valid values: LeftToRight BottomToTop FrontToBack DiagonalUp DiagonalDown
Chapter 5: Supporting Tags 129
Requirements: fillType=“Gradient” <sas:BackgroundFillStyle fillType="Gradient" gradientFillBeginColor="red" gradientFillEndColor="yellow" gradientFill="DiagonalDown" />
imageFillColor The imageFillColor attribute sets the color used to fill the area before the image is applied. This attribute can be used only when the fillType attribute is defined using one of the image types. (This attribute did not function with the tested release.)
imageFill The imageFill attribute defines how to display the image specified and can be used only when the fillType defines an image type. (This attribute did not function with the tested release.)
imageIcon The imageIcon attribute sets the image to use. This attribute can be used only when the fillType attribute is defined using one of the image types. (This attribute did not function with the tested release.)
solidBlendColor To define the color that is applied to the area after the image has been applied, use the solidBlendColor attribute. This attribute can be used only with fillType=“ImageColorBlend”. (This attribute did not function with the tested release.)
x The x attribute defines the x coordinate used with the image. (This attribute did not function with the tested release.)
y The y attribute defines the y coordinate used with the image.
130 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
(This attribute did not function with the tested release.) In general only the solid color fills function correctly with the tested release. Just be aware of this when constructing your own graphs.
5.2 Line Tags 5.2.1 AxisLineStyle, GridLineStyle, StrokeLineStyle, FramelineStyle, and OutlineLineStyle There are several different types of line tags to use. The AxisLineStyle, GridLineStyle and StrokeLineStyle tags affect the axis, grids and strokes. The FrameLineStyle and OutlineLineStyle tags (used in the following examples) control the frame and the outline of the referenced graph area. The FrameLineStyle tag sets attributes for the frame of the referenced graph area. In this example, the FrameLineStyle tag is nested within a sas:LegendModel tag.
<sas:FrameLineStyle color="red" thickness="5px" visibilityPolicy="true"/>
Chapter 5: Supporting Tags 131
The OutlineLineStyle tag sets attributes for the outline of the referenced graph area. In this example, the OutlineLineStyle tag is nested within a sas:DataElementStyles tag.
<sas:OutlineLineStyle color="red" thickness="3px" />
All of the Line tags share the following attributes.
color The color attribute defines the color to use for the line. Valid values: <String> (This value can be any valid Java java.awt.Color or hexadecimal value representing a color.)
<sas:AxisLineStyle color="red" SASGraphLineStyle="SASGRAPHLINE15" thickness="5px" visibilityPolicy="true"/>
132 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
thickness The thickness attribute defines the thickness or weight of the line. Valid values: <Measure> The <Measure> value can be px (pixels), pt (points), cm (centimeters), or in (inches). Examples of valid values: 50px, 3cm, 1in
<sas:OutlineLineStyle color="red" thickness="3px" />
SASGraphLineStyle The SASGraphLineStyle attribute sets the type of line to use. The values include a solid line (SASGRAPHLINE1) and combinations of dashes, dots, and solids (SASGRAPHLINE2 through 46). Refer to the webAF Online Help for samples of the line styles. Valid values: SASGRAPHLINE1 through SASGRAPHLINE46
<sas:GridLineStyle color="red" SASGraphLineStyle="SASGRAPHLINE15" thickness="5px" visibilityPolicy="true"/>
Chapter 5: Supporting Tags 133
5.2.2 BasicStroke Another line style is the BasicStroke tag. This tag has the following attributes: dashPhase, dashSegmentsChanged, endCap, lineJoin, lineWidth, and miterLimit. (This tag did not function with the tested release.) A tag that can be nested in the BasicStroke tag is the DashSegment tag. This tag has one attribute, length. (This tag did not function with the tested release.)
5.3 Text Tags Most of the text tags do very similar things. The Font tag defines the type of font to use. The LabelTextStyle and ValueTextStyle tags describe labels and values in a graph. The base TextStyle tag works on general text elements. The ShadowStyle tag defines any shadows used with text.
5.3.1 Font The Font tag defines the type of font to use. It enables you to define such things as whether the font is bold or italic. It can adjust the font size and specify a font family such as Arial or Times New Roman. This tag has four attributes that are all shown in this one example. In this case, the Font tag has been nested inside the sas:LabelTextStyle tag for the sas:CategoryAxisModel.
<sas:Font bold="true" family="Helvetica" italic="true" size="14.0" />
bold The bold attribute takes a Boolean value and specifies whether the text should be bolded. Valid values: Boolean (True/False)
134 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
family You can define what font family you want to use by setting the family attribute. Valid values: <String> (java.awt.Font)
italic The italic attribute enables you to set the font to italic. Valid values: Boolean (True/False)
size The size attribute enables you to customize the font size to use with the text you are describing. Valid values:
5.3.2 LabelTextStyle and ValueTextStyle The next couple of tags are the LabelTextStyle and ValueTextStyle tags. They enable you to define how the text for labels and values should look. Each has only two attributes, both shown in this example. These have been nested inside the sas:LabelTextStyle tag for the sas:CategoryAxisModel.
<sas:LabelTextStyle color="red" justification="left" />
Chapter 5: Supporting Tags 135
<sas:ValueTextStyle color="red" justification="left" />
color The color attribute defines what color to use when displaying the text you are describing. Valid values: <String> (This value can be any valid Java java.awt.Color or hexadecimal value representing a color.)
justification The justification attribute enables you to set the justification properties of the text. Valid values: Left Right Center
136 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
5.3.3 TextStyle The TextStyle tag is very similar to the LabelTextStyle and ValueTextStyle tags. In addition to controlling the color and justification, you can also use this tag to set the angle of the text in relation to the baseline. Notice the text is to the left of the baseline.
<sas:TextStyle baselineAngle="50.0" color="red" justification="left" />
baselineAngle The baselineAngle attribute defines the angle at which to write the text. Valid values:
5.3.4 ShadowStyle The ShadowStyle tag is used to define shadows. There are four visual attributes: color, offsetX, offsetY, and softness. (This tag did not function with the tested release.)
5.4 Tick Mark Tags Two tags are responsible for describing tick marks in the graphs, MajorTickStyle and MinorTickStyle. The MajorTickStyle tag is responsible for all major tick marks, whereas the MinorTickStyle tag is responsible for all minor tick marks, if any. Each have two attributes, length and placement.
Chapter 5: Supporting Tags 137
length The length attribute sets the base length of the tick marks. Valid values: <Measure> The <Measure> value can be px (pixels), pt (points), cm (centimeters), or in (inches). Examples of valid values: 50px, 3cm, 1in
placement The placement attribute enables you to define how the tick mark should be placed in relationship to the graph axes. Valid values: Inside Outside Across (None of these attributes functioned with the tested release.)
5.5 Miscellaneous Tags There are a few miscellaneous supporting tags, such as DiscreteFillColor, MarkerStyle and ReferenceLineModel.
5.5.1 DiscreteFillColor The DiscreteFillColor tag applies to data elements and has one attribute, value. (This tag did not function with the tested release.)
5.5.2 MarkerStyle The MarkerStyle tag enables you to describe the visual aspects of markers in plots. It has several attributes, as shown in the following example. This example shows the MarkerStyle tag nested inside a sas:DataElementStyles tag.
138 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
<sas:MarkerStyle color="red" connectionOrder="X" interpolation="Straight" size="20px" symbol="aster" />
color The color attribute defines the color to use for the markers. In the preceding example there are two data elements. Only the first data element (response) uses the red color specified in the attribute (in this example, this shows up as the bolder items). The second data element (shown as gray) uses a default color. Valid values: <String> (This value can be any valid Java java.awt.Color or hexadecimal value representing a color.)
connectionOrder To determine the order in which the data elements are connected, you can use the connectionOrder attribute. Valid values: Data X Y
Chapter 5: Supporting Tags 139
interpolation The interpolation attribute enables you to define whether and how the markers are connected. Valid values: None Default Straight StepLeft StepCenter
StepRight Spline VerticalNeedles HorizontalNeedles BoxPlot
size You can define the size of the markers using the size attribute. Valid values: <Measure> The <Measure> value can be px (pixels), pt (points), cm (centimeters), or in (inches). Examples of valid values: 50px, 3cm, 1in
symbol There are many different shapes you can use for your markers. You can define these using the symbol attribute. Valid values: None, Circle, Plus, Triangle, Square, X, TriangleDown, Diamond, Aster, CircleBold, PlusBold, TriangleBold, SquareBold, XBold, TriangleDownBold, DiamondBold, AsterBold, CircleFilled, CrossFilled, TriangleFilled, SquareFilled, SaltireFilled, TriangleDownFilled, DiamondFilled, StarFilled, Venus, Mars, Earth, VenusBold, MarsBold, EarthBold, VenusFilled, MarsFilled, EarthFilled, Horizontal, Vertical, HorizontalBold, VerticalBold, RectangleHorizontalFilled, RectangleVerticalFilled, PlusX, CirclePlus, CircleX, SquarePlus, SquareX, SquareUp, SquareDown, SquareLeft, SquareRight, UpDown, LeftRight, DiamondPlus, DiamondX, Cross, Saltire, Star, CrossMaltese, Hash, Smash, Asterisk, TriangleLeft, TriangleRight, LessThan, GreaterThan, Tilde, Wreath, Union, Ibeam, Hex, Home, Heart, Tack, Sporal, Weave, HomeDown, FixedStar, Chain, Arrow, DiamondNarrow, HomeNarrow, HomeNarrowDown, Dagger, Flag, CircleTriangle, CircleTriangleDown, CircleOdd, ArrowWide, ArrowWideDown, CircleArrowWide, CircleArrowWideDown, Hourglass, TriangleLeftBold, TriangleRightBold, AsteriskBold, UnionBold, IbeamBold, HexBold,
140 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
HomeBold, HeartBold, TackBold, SpiralBold, WeaveBold, HomeDownBold, FixedStarBold, ChainBold, ArrowBold, TriangleLeftFilled, TriangleRightFilled, HomeFilled, HomeDownFilled, DiamondNarrowFilled, HomeNarrowFilled, HomeNarrowDownFilled, FlagFilled, ArrowWideFilled, ArrowWideDownFilled, CircleArrowWideFilled, CircleArrowWideDownFilled, CircleTriangleFilled, CircleTriangleDownFilled, CircleOddFilled, HourGlassFilled, FemaleFigureFilled, MaleFigureFilled, RectangleHorizontal, RectangleVertical
5.5.3 ReferenceLineModel The ReferenceLineModel tag is normally used to support an axis definition.
<sas:ReferenceLineModel inFront="true" label="Goal" labelPlacement="outside" position="250000.0" visible="true" />
The following are the supporting attributes.
inFront The inFront attribute takes a Boolean value and places the reference line in front of or behind the graph (in this case bars). Valid values: Boolean (True/False)
label The label attribute enables you to define a label for the reference line.
Chapter 5: Supporting Tags 141
Valid values: <String>
labelPlacement The labelPlacement attribute defines where to put the label in relationship to the graph. Valid values: Inside Outside InsideHigh InsideLow
position To position the reference line at a specific point on the graph, use the position attribute. Valid values:
142 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
P a r t
2
Output Delivery System Chapter
6 Important Concepts for Getting Started with ODS and Java 145
Chapter
7 Creating Graphs 153
Chapter
8 Parameters for Colors 169
Chapter
9 Parameters for Text 207
Chapter 10 Other Parameters 241
144 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
Part 2 is all about how to use more traditional SAS code, including the Output Delivery System (ODS), and Java together to get results that might not be possible with the defined SAS AppDev Studio custom tags. Many of the custom tags have limitations; however, that is not to say that ODS using a Java device does not have its own limitations. The following chapters cover some basics before diving deeper. We concentrate only on using SAS/GRAPH software and ODS with the Java device. There are many other publications that cover other uses of SAS/GRAPH software and ODS in more depth.
C h a p t e r
6
Important Concepts for Getting Started with ODS and Java 6.1 Java Scriptlet Code 146 6.2 General JSP Structure 146 6.3 General JSP Requirements 148 6.4 Connecting and Data Extraction 148 6.5 A Few Last Notes about Data 151
This chapter is designed to cover things that are common to almost all examples. After reading this chapter, you will be able to skip around to look over the graphs you are most interested in. Each of the graph examples is self-contained, so you will see some repetition of attributes. The following sections briefly explain some general concepts for using Java and SAS together in a JavaServer Page (JSP) file.
146 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
Note: For brevity in this book, we have decided to use SocketListener and SubmitInterface objects. These objects utilize the SAS/CONNECT product and in general are easier and quicker to set up. The purpose of this book is to provide visual aids and information concerning what you can do with graphs using Java. In a production environment, you would not want to use the example or ® SubmitInterface objects. SAS 9 has extensive tools with which to create more robust applications.
6.1 Java Scriptlet Code When you combine HTML, Java, and SAS, you need some way to distinguish one from the other. There is no one translating Web system that will interpret all three of these languages without some way of keeping them separated. HTML consists of tags that you can use openly in a JSP, HTML page, and many other types of Web page files. However, to distinguish a section of code, such as Java, that may need to be interpreted differently, you need some way to set it apart. You do this by using scriptlet coding. This just means that you use to open and close sections of code that need to be pure Java. To use SAS in a JSP file, you can use the SubmitInterface. The syntax is explained later in this chapter. What this object does is break down your SAS code into a long stream that is sent to the connected SAS server for interpretation of the code. Basically the file is read in by the application server and compiled, and then it all runs. So there is a bunch of stuff happening on your server to get this mixed JSP file to produce a graph.
6.2 General JSP Structure Java Server Pages and SAS can live and work together. However, there are several pieces you need along the way to make this happen. When you are getting started, easier is better. In a production environment, you need a more robust and complete approach. We have combined the use of SAS/CONNECT software, a SocketListener, and the sasads:Submit tag to write most of the ODS examples. This is an example of a complete JSP file that connects to SAS, creates a graph from an existing SAS data set, and sends it back for display.
Chapter 6: Important Concepts for Getting Started with ODS and Java 147
<sasads:Connection id="bbuConnection" scope="session" /> <sasads:Submit id="smbStreamingBar" display="none" connection="bbuConnection"> libname samples ''; filename sock SOCKET ':'; goptions reset=all device=java xpixels=600 ypixels=400; ods listing close; ODS HTML body=sock rs=none CODEBASE="" ; proc gchart data=samples.grains; hbar country / sumvar=amount; run; quit; ods html close;
148 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
6.3 General JSP Requirements The first piece we’ll look at are the lines required by JSP files when using Java code and tag libraries. At the very top of the sample JSP, you will notice a declaration of the tag library. In this case we’ve elected to use the sasads:Connection tag, which can be found in the SAS AppDev Studio 2 tag library. The sasads:Connection tag is discussed later in this chapter.
Next we need to import all the Java classes needed. Because of the way we wrote the Java code, these import statements are the minimum required for our examples. More import statements might be needed if you add additional Java functionality to the JSP.
6.4 Connecting and Data Extraction To communicate back to the data server, we have chosen to use SAS/CONNECT software and the sasads:Connection tag. This choice was made for pure ease of use. The sasads:Connection tag by default uses the SAS/CONNECT spawner. The default assumption is that the spawner runs on port 2323. When we use the defaults, the only things we need to do are give the connection object a name via the id statement and tell the application server how long this object should exist during execution via the scope statement. <sasads:Connection id="bbuConnection" scope="session" />
Next we define a little bit of HTML—not much, just enough to indicate the start of any output statements. After that the fun begins. We have Java scriptlet code (which is Java code embedded in a JSP and sometime intermingled with HTML). In this section we need to define a SocketListener Java object (for use in streaming back our graph output) and several Java variables to use later in the JSP. We need to use the SocketListener to grab the assigned port number, get the host address used for this application, set up the path to the archives or JAR files, and set a string representing the SAS library we will be assigning later. Finally, we start the socket.
Chapter 6: Important Concepts for Getting Started with ODS and Java 149
Now that we have established our connection and opened up a socket for use, we can use the sasads:Submit tag (which uses the com.sas.sasserver.submit.SubmitInterface class) to send SAS code to the server to run. The tag needs to define a connection object for use. We have one already set up earlier in the page called bbuConnection. Now anywhere between the opening sasads:Submit tag and the close sasads:Submit tag we can write standard SAS Code. <sasads:Submit id="smbStreamingBar" display="none" connection="bbuConnection"> libname samples ''; filename sock SOCKET ':'; goptions reset=all device=java xpixels=600 ypixels=400; ods listing close; ODS HTML body=sock rs=none CODEBASE="" ; proc gchart data=samples.grains; hbar country / sumvar=amount; run; quit; ods html close;
One of the first things most SAS programs need is a LIBNAME statement. Therefore we have used the Java variable we had set up earlier in the JSP page called libraryPath to assign the library “samples”. Next the SAS statements need to utilize the socket to stream its content back through to the browser. To do this, we use a FILENAME statement. The filename also needs two of the previously assigned Java variables, host and port, to complete the filename set up.
150 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
The GOPTIONS statement sets graphing options. The RESET option restores the defaults and can cancel global statements. In this example, we have chosen to reset all graphical options and cancel all global statements. An important element in SAS when delivering graphs to a system based on Java is to define the appropriate device to use. For the purpose of this book, the device we use is Java, which we specify with DEVICE=JAVA. The XPIXELS and YPIXELS options help to define the display area in pixels, where XPIXELS is the width and YPIXELS the height. These options are device-dependent and can only use values between 0 and 99999. Our first instruction to ODS is to close the listing. This allows us to open ODS to direct the output back to HTML. We do this with the ODS HTML statement. The ODS HTML statement has three options defined in this example: BODY, RS, and CODEBASE. The BODY=SOCK option tells the ODS statement that the body of the output will stream the results back to the browser using the filename sock. With the RS=NONE (record_separator) option, the ODS output is automatically formatted for the operating system where the SAS job runs. When using DEVICE=JAVA with ODS, you need to define the location of the graph applet JAR files using the CODEBASE option. In ® a standard Windows installation of SAS 9 these JAR files can be found here: /SAS9.1/common/applets. This path is called the ® archivePath in the example. There was a change from SAS 8.2 to SAS 9 so that you now only have to define the path to the directory where you store the JAR files for the applets. The PROC GCHART statements are used to produce the graph. Finally, we need ODS to close the HTML output. This prevents any following SAS statements from adversely affecting the output. In the LIBNAME, FILENAME and the ODS HTML statements, we used Java variables inside of scriptlet code. These are not required. You could just code the values. The Java variables provide a convenient way to put code that could change near the top of the JSP file. We believe that once you get used to using scriptlet variables, you will find them very handy. Remember that all these examples were run locally. If you are running on a production, test, or development server, your paths might be somewhat different, and you need to be sure to copy the correct JAR files over to the server. For example, if you are running on a Tomcat server and you want these JAR files to be accessible only by your current application, you might try putting them here: /webapps/<myCurrentApplication>/assets/graphApplets or something similar. For this example, we have used /webapps/BBU/assets/graph.
Chapter 6: Important Concepts for Getting Started with ODS and Java 151
Now all that is left to do is to clean up the socket so it is not left open. Then end the HTML output section.
In summary, you need to define the tag library, import Java classes, open a connection, get a socket, and write some SAS code. It’s always good form to close any open sockets, connections, and anything else that might be open.
6.5 A Few Last Notes about Data The data we used in this book is the standard samples data sets that come with a regular installation of SAS/GRAPH software. This data can be found in /SAS9.1/graph/sample. In a SAS program, if you omit the DATA= option, the procedure uses the most recently created SAS data set in the current SAS session. If there was not a previously created data set, then a SAS error occurs and the procedure stops. When running SAS/GRAPH procedures, the SAS system applies a lock to the input data set. This lock prevents another user or process from updating the data at same time. If, however, the data changes while you are using it, unpredictable results can occur, as well as the processing ending in errors.
152 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
C h a p t e r
7
Creating Graphs 7.1 Types of Bar Charts 154 7.1.1 Horizontal Bar Charts 154 7.1.2 Vertical Bar Charts 155 7.2 Types of Pie Charts 156 7.2.1 Pie Charts 157 7.2.2 Donut Charts 158 7.2.3 Star Charts 159 7.3 Contour Plots 159 7.4 Types of Maps 160 7.4.1 Block Maps 160 7.4.2 Choropleth Maps 161 7.4.3 Prism Maps 162 7.4.4 Surface Maps 163 7.5 Types of Plots 163 7.5.1 Bubble Plots 164 7.5.2 Plots 165
154 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
7.6 Three-Dimensional Graphs 166 7.6.1 Scatter Plots 166 7.6.2 Surface Plots 167
This chapter provides an overview of the types of graphs, charts, plots and maps that are possible with the SAS Java device. It is meant to show you how to use the different graph applets, rather than providing an exhaustive sampling of all SAS graphing techniques.
7.1 Types of Bar Charts Bar charts represent statistics over one or more variables. In the example, the amount is summarized per country. This gives the user a way to interpret the differences of amounts across countries.
7.1.1 Horizontal Bar Charts Bar charts use the SAS GCHART procedure. The action statement names the type of chart, the data being charted, and any options.
proc gchart data=samples.grains; hbar country / sumvar=amount; run;
Chapter 7: Creating Graphs 155
In the horizontal bar chart example, we are creating a chart using the country and amount variables. HBAR is the type of chart, and COUNTRY is the category variable we are going to chart. These elements of the code are required. A slash separates the category variable from the options. We want to chart the AMOUNT variable for each COUNTRY. To do this we use the SUMVAR= option. To make our horizontal bar chart three-dimensional, we simply change the type of chart to HBAR3D. All the other statements stay the same.
proc gchart data=samples.grains; hbar3d country / sumvar=amount; run;
7.1.2 Vertical Bar Charts For a vertical bar chart, change the type of chart to VBAR. All the other statements stay the same.
156 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
proc gchart data=samples.grains; vbar country / sumvar=amount; run;
Use the chart type VBAR3D to create a three-dimensional vertical bar chart. All the other statements stay the same.
proc gchart data=samples.grains; vbar3d country / sumvar=amount; run;
7.2 Types of Pie Charts In general, pie and donut charts show the user the relationship of each summarized item against the total of all summarized items. For instance, in this example we see that when compared to the amounts for US and Canada, Australia holds a small percentage of the total of all types of grains. The defaults that SAS uses for the positioning of the slices and the color can be changed with options that we review later.
Chapter 7: Creating Graphs 157
7.2.1 Pie Charts
proc gchart data=samples.grains; pie country / sumvar=amount; run;
Like the bar charts, pie and donut charts use the SAS GCHART procedure. The action statement defines the type of chart, the data being charted, and any options. In the pie chart example, we are creating a pie chart with the COUNTRY variable. PIE is the type of chart, and COUNTRY is the category variable we are going to chart. These are required. A slash separates the category variable from the options. We want to chart the AMOUNT variable for each COUNTRY. To do this we use the SUMVAR= option. proc gchart data=samples.grains; pie country / sumvar=amount; run;
158 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
To make a three-dimensional pie chart, change the type of chart to PIE3D. All the other statements stay the same.
proc gchart data=samples.grains; pie3d country / sumvar=amount; run;
7.2.2 Donut Charts For a donut chart, change the type of chart to DONUT. All the other statements stay the same.
proc gchart data=samples.grains; donut country / sumvar=amount; run;
Chapter 7: Creating Graphs 159
7.2.3 Star Charts A star chart is a cross between a vertical bar chart and a pie chart, with the data points radiating from a center point. The code is very similar to a pie chart, but uses the chart type of STAR. The star chart is not fully supported and in our testing produced what looked like a pie chart. proc gchart data=samples.grains; star country / sumvar=amount; run;
7.3 Contour Plots Contour plots use lines or patterns to represent levels of magnitude of variable(s) plotted on the horizontal and vertical axes. They are useful when examining trends where the level of the data, not the shape, is important.
proc gcontour data=work.clay; plot y*x=pct_clay / levels=10 to 90 by 5 ; run;
A contour plot uses the SAS GCONTOUR procedure. In this example, we are using a subset of the samples.clay data set as our sample data. Note that in this example a chunk of the graph appears to be missing. This is due to missing values in the data and is not an error in the graph. For a simple contour plot, the required action statement PLOT is used.
160 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
In our example, we want to run the contour plot using the X, Y and PCT_CLAY variables. The X variable is plotted on the horizontal axis. The Y variable is plotted on the vertical axis. The PCT_CLAY variable plots the contour lines and can be thought of as a type of z axis.
7.4 Types of Maps Maps can be used to summarize data by physical area, show trends in geographic regions, and highlight extremes. In these examples, the graphs show the concentration of sites in a state.
7.4.1 Block Maps Block maps use the SAS GMAP procedure. With the GMAP procedure, you are required to define a map data set and a response data set. Here we have used the U.S. map (maps.us), and the response data set is samples.rgnsites. You can use the same data set as both the map and response; see the SAS Help on the GMAP procedure for details.
proc gmap map=maps.us data=samples.rgnsites; id state; block sites; run;
The next action statements help define the visual aspects of the map by naming the variable which joins the map data, the type of map and the data being mapped, and any additional options.
Chapter 7: Creating Graphs 161
The ID statement is required and names a variable that must be present in both map and response data definitions. It is used to join the data sets and define the mapped region; in this case, we use the STATE variable. For a simple block map, the required BLOCK statement represents the type of map and names the variable being mapped. Here we have defined the BLOCK statement and named the SITES variable (which defines the height of the blocks on the map).
7.4.2 Choropleth Maps Choropleth two-dimensional maps fill in map areas with combinations of patterns and colors to represent the data values. To make a choropleth map, just change the type of map to CHORO from BLOCK. All the other statements stay the same.
proc gmap map=maps.us data=samples.rgnsites; id state; choro sites; run;
162 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
7.4.3 Prism Maps Prism three-dimensional maps display data by raising the map areas and filling them with combinations of patterns and colors. To create a PRISM Map, change the type of map to PRISM from CHORO in the PROC GMAP definition. All other statements remain the same.
proc gmap map=maps.us data=samples.rgnsites; id state; prism sites; run;
Chapter 7: Creating Graphs 163
7.4.4 Surface Maps Surface maps are only partially supported. In our testing they displayed a map similar to a choropleth map.
proc gmap map=maps.us data=samples.rgnsites; id state; surface sites; run;
7.5 Types of Plots A plot shows the relationship of one variable to another. It is useful for displaying long series of data for trends and patterns. Plots also have the option to create a secondary comparison axis on the right side of the chart. This allows the user to compare and contrast three variables where one axis stays the same. In our examples, we’re looking at the energy consumed by year in one or two currencies. In order to do this, we had to create a work data set with additional variables. We used the samples.energy1 data set to create the work.energyPrice data set.
164 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
proc sql; create table work.energyPrice as select year as year, consumed as energy, consumed*.03 as dollars, consumed*.03*125 as yen from samples.energy1; quit;
7.5.1 Bubble Plots Bubble plots use the SAS GPLOT procedure. Using the graph type of BUBBLE, we define the three chart variables. In this example, we have used DOLLARS as the y axis, YEAR as the x axis, and ENERGY as the size of the bubble.
proc gplot data=work.energyPrice; bubble dollars*year=energy; run;
Use a second bubble statement, BUBBLE2, to create a bubble plot with a second y axis on the right side to compare another variable on the same graph. The BUBBLE2 statement produces a graph to compare the original DOLLARS variable to the YEN variable across the same YEAR and ENERGY.
Chapter 7: Creating Graphs 165
proc gplot data=work.energyPrice; bubble dollars*year=energy; bubble2 yen*year=energy; run;
7.5.2 Plots A regular plot is very similar to a bubble plot, except there is no variable to affect the size of the plot marker. In a plot chart all the markers are the same size. Use a PLOT statement instead of the BUBBLE statement. A plot denotes the crossing or intersection of the two variables. Here we have chosen to plot the intersection between the variables DOLLARS and YEAR.
proc gplot data=work.energyPrice; plot dollars*year; run;
A plot can also have a second y axis to use as a comparison value. You can accomplish this by using the PLOT2 statement. In this example, we are comparing dollars to yen, so in the PLOT2 statement we use YEN and YEAR as our comparison variables.
166 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
proc gplot data=work.energyPrice; plot dollars*year; plot2 yen*year; run;
7.6 Three-Dimensional Graphs The G3D procedure produces three-dimensional graphs. This procedure enables you to create a graph which plots the intersection of three variable values. All three variables must be numeric.
7.6.1 Scatter Plots In the three-dimensional scatter plot example, we are creating a scatter plot with its type defined as SCATTER and the data variables PETALLEN, PETALWID, and SEPALLEN. Three numeric variables are required. The order of the variables determines the axis. The first variable is always plotted on the y axis. The second variable is always plotted on the x axis. The last variable is plotted on the z axis. The pattern is y*x=z.
proc g3d data=samples.giris; scatter petallen*petalwid=sepallen; run;
Chapter 7: Creating Graphs 167
7.6.2 Surface Plots The three-dimensional surface plot can be created using the SAS G3D procedure. The samples.hat data set contains three variables used by the G3D procedure. Variable Y represents the y axis, X the x axis, and Z the z axis. All three variables contain numeric values, which creates a gridlike structure on the graph.
proc g3d data=samples.hat; plot y*x=z; run;
168 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
C h a p t e r
8
Parameters for Colors 8.1 ODS Parameters 170 8.1.1 Non-supported parameters 181 8.2 GOPTIONS 182 8.2.1 Non-supported options 186 8.3 PROC GCHART 186 8.3.1 Summary 192 8.3.2 Non-supported parameters 193 8.4 PROC GCONTOUR 193 8.4.1 Summary 197 8.5 PROC GMAP 197 8.5.1 Summary 199 8.6 PROC GPLOT 199 8.6.1 Summary 204 8.7 PROC G3D 204 8.7.1 Summary 205 8.7.2 Non-supported parameters 205
170 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
8.1 ODS Parameters You can use ODS parameters to customize the appearance of your graphs. In this chapter we use the more common color parameters to dramatically change the look of the basic graphs. In the ODS statement, the PARAMETERS= option defines parameters to be passed to a Java applet. Not all parameters work with all the applets. In each parameter section, we note where the parameter is applicable. The parameters are specified in the PARAMETERS= option in the ODS HTML statement as name/value pairs. The applet parameter names are not case sensitive. However, some applet parameter values are case sensitive. In this section, we show only the ODS HTML code. To see the ODS statements in context, review the beginning or ending chapters of this book. Full examples are provided in those sections.
AMBIENT The AMBIENT parameter specifies the nondirectional light on the graph. The valid ranges are from 0.0 to 1.0, with a default of 0.4. This parameter is valid when producing Contour applets or when using PROC GCONTOUR or PROC G3D with plots. The AMBIENT parameter is used with the DIRECT parameter. When either is used, the other, if not specified, is implied. Their values should equal 1.0. Since the default for AMBIENT is 0.4, this means that the default for DIRECT is 0.6. If you set the AMBIENT parameter to something higher than 0.4, you need to also adjust the setting for the DIRECT parameter. This is because DIRECT takes precedence. If DIRECT is not defined, it assumes a value of 0.6 and automatically adjusts AMBIENT to 0.4 so that in combination they equal 1.0. The following example compares a PROC G3D plot with and without the AMBIENT parameter. The example on the left (code not shown) is using the default settings for the parameters AMBIENT and DIRECT. The example on the right is using an AMBIENT setting of 0.8 and a DIRECT setting of 0.2.
Chapter 8: Parameters for Colors 171
Default Settings
AMBIENT=0.8 and DIRECT=0.2
ODS HTML body=sock rs=none CODEBASE="" parameters=("AMBIENT"="0.8") parameters=("DIRECT"="0.2");
BACKDROPCOLOR The BACKDROPCOLOR parameter sets the color of the walls and floor of the graph. This worked in our examples using PROC GCONTOUR, PROC GCHART, and PROC G3D. However, it did not work with PROC GMAP.
ODS HTML body=sock rs=none CODEBASE="" parameters=("BACKDROPCOLOR"="yellow");
172 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
BACKIMAGE You can use the BACKIMAGE parameter to place an image in the background of the graphic area inside the applet. In this example, we can clearly see that the map portion of the applet is the graphical area and contains the background image. On the other hand, the legend, which is still part of the applet, does not contain any portion of the image. This parameter does not work with PROC GCHART. ODS HTML body=sock rs=none CODEBASE="" parameters=( "backimage"="http://localhost:8095/BBU/images/earth_dim.gif");
By default, the BACKIMAGE parameter scales to fit the graphical region. Use the DRAWIMAGE parameter to change the location.
Chapter 8: Parameters for Colors 173
COLORSCHEME You can use a predefined series of colors for your chart by using the COLORSCHEME parameter. The GOPTIONS COLORS= option also specifies a string of colors to use in the chart. If both are specified, the GOPTIONS option overrides any color scheme. Valid values: Autumn, Bright Carnival Commerce Festival Grayscale Industry Magellan Neon
Ocean Pastel Picnic Pine Seaside Terra Wheat Woodland
ODS HTML body=sock rs=none CODEBASE="" parameters=("colorscheme"="GRAYSCALE");
Note: As of SAS 9.1.3, the COLORSCHEME parameter is only partially supported when used with bar charts. This should be corrected with SAS 9.2. This parameter is also supported by the Graph applet.
DIRECT The DIRECT parameter specifies the light intensity from direct light. The valid range is from 0.0 to 1.0. This parameter is used with the parameter AMBIENT. See the section on the AMBIENT parameter earlier in this chapter for details.
174 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
DRAWIMAGE The DRAWIMAGE parameter is used with the BACKIMAGE parameter to specify the location of the image in the applet area. There are four valid options: CENTER, POSITION, SCALE, and TILE. For SAS 9.1.3, the default position when using the DRAWIMAGE parameter with PROC GMAP is centered, as shown below. CENTER: Notice that the background image here is the image of the world. However, it is behind the current map and so is effectively hidden. You can see the rectangle behind the map, which is where the image is.
ODS HTML body=sock rs=none CODEBASE="" parameters=( "backimage"="http://localhost:8095/BBU/images/earth_dim.gif" "drawimage"="center");
POSITION: The position of the background image here is similar to that for the CENTER option in that it is hidden behind the map. The POSITION option can also be used with the IMAGEPOSY and IMAGEPOSX parameters to place the image in a specific location within the graphic area.
Chapter 8: Parameters for Colors 175
ODS HTML body=sock rs=none CODEBASE="" parameters=( "backimage"="http://localhost:8095/BBU/images/earth_dim.gif" "drawimage"="position");
SCALE: This example shows the background image scaled to fit the area reserved for the map output.
ODS HTML body=sock rs=none CODEBASE="" parameters=( "backimage"="http://localhost:8095/BBU/images/earth_dim.gif" "drawimage"="scale");
TILE: This example shows the background image tiled throughout the reserved map output area.
176 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
ODS HTML body=sock rs=none CODEBASE="" parameters=( "backimage"="http://localhost:8095/BBU/images/earth_dim.gif" "drawimage"="tile");
GRADIENTBACKGROUND, GRADIENTENDCOLOR, and GRADIENTSTARTCOLOR You can use the GRADIENTBACKGROUND parameter to override any previously set gradients applied to the applet’s background. You can also use it to define the gradient’s orientation. Valid options to use with this parameter are TRUE, FALSE, VERTICAL, and HORIZONTAL. The TRUE and FALSE options allow you to either retain a previously set GRADIENTBACKGROUND parameter or dismiss it. The VERTICAL and HORIZONTAL options define the orientation of the gradient colors defined with the GRADIENTENDCOLOR and GRADIENTSTARTCOLOR parameters. In the tested release, gradients did not work with the Graph applet or bar charts. These examples show the four different parameter values.
TRUE
FALSE
VERTICAL
HORIZONTAL
Chapter 8: Parameters for Colors 177
The GRADIENTENDCOLOR and GRADIENTSTARTCOLOR parameters are used with the GRADIENTBACKGROUND HORIZONTAL or VERTICAL options. These two parameters define the color to use at the starting and ending points of the gradient. The starting points are from the top down for the VERTICAL option and from left to right for the HORIZONTAL option. So if you define red as the start color and yellow as the ending color with GRADIENTBACKGROUND=VERTICAL, the red will turn to yellow from the top down. With the HORIZONTAL option, red will start the gradient on the left and yellow will end the gradient on the right. The default start color is white and the default end color is blue. Also, if the parameter BACKIMAGE is used, gradient parameters are ignored. ODS HTML body=sock rs=none CODEBASE="" parameters=("gradientbackground"="vertical" "gradientstartcolor"="red" "gradientendcolor"="yellow"); ODS HTML body=sock rs=none CODEBASE="" parameters=("gradientbackground"="vertical" "gradientstartcolor"="yellow" "gradientendcolor"="red");
LIGHTING The LIGHTING parameter specifies the position of the light source. There are four valid options for use with this parameter: HEADLIGHT, OVERHEAD, NORTHEAST, and SOUTHEAST. The default value is HEADLIGHT. The following examples show the different options. The LIGHTING parameter is supported only with the Contour applet.
178 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
HEADLIGHT
OVERHEAD
NORTHEAST
SOUTHEAST
ODS HTML body=sock rs=none CODEBASE="" parameters=("LIGHTING"="HEADLIGHT"); ODS HTML body=sock rs=none CODEBASE="" parameters=("LIGHTING"="OVERHEAD"); ODS HTML body=sock rs=none CODEBASE="" parameters=("LIGHTING"="NORTHEAST"); ODS HTML body=sock rs=none CODEBASE="" parameters=("LIGHTING"="SOUTHEAST");
SHOWBACKDROP The SHOWBACKDROP parameter has two valid values, TRUE or FALSE, which allow or disallow the walls and floor to be shown on the graph. Like the LIGHTING parameter, this is supported only with the Contour applet.
Chapter 8: Parameters for Colors 179
TRUE
FALSE
ODS HTML body=sock rs=none CODEBASE="" parameters=("SHOWBACKDROP"="FALSE");
TIPBACKCOLOR The TIPBACKCOLOR parameter specifies the background color of the data tips. This parameter is supported by the following procedures: G3D, GCONTOUR, and GMAP. In this example, we have changed the value of the TIPBACKCOLOR parameter to RED. The default color is yellow.
ODS HTML body=sock rs=none CODEBASE="" parameters=("TIPBACKCOLOR"="RED");
180 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
TIPBORDERCOLOR The TIPBORDERCOLOR parameter specifies the color of the border around the data tip area. This parameter is supported by PROC G3D and PROC GCONTOUR. In this example, we have changed the value of the TIPBORDERCOLOR parameter to RED. The default color is black.
ODS HTML body=sock rs=none CODEBASE="" parameters=("TIPBORDERCOLOR"="RED");
TIPTEXTCOLOR The TIPTEXTCOLOR parameter defines the color of the data tip text. This parameter works with PROC G3D (Surface), PROC GCONTOUR, and PROC GMAP. In this example, we have changed the value of the TIPTEXTCOLOR parameter to RED. The default color is black.
Chapter 8: Parameters for Colors 181
Curiously, with PROC GMAP this parameter also changes the border color.
ODS HTML body=sock rs=none CODEBASE="" parameters=("TIPTEXTCOLOR"="RED");
8.1.1 Non-supported parameters ®
Not all ODS color parameters from SAS 8.2 are available in SAS 9. The parameters ® listed here are ignored in SAS 9. BACKCOLOR
The BACKCOLOR parameter specifies the background color of the applet area. This item is no longer supported with ® SAS 9. There are alternatives, however, using the procedure options.
OUTLINECOLOR
The OUTLINECOLOR parameter defines the color to use for ® outlines of graphs. The SAS 9 documentation lists this as a ® valid option; however, it has been dropped for SAS 9 in lieu of using the SAS/GRAPH options for OUTLINECOLOR.
182 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
8.2 GOPTIONS This section covers color options for the SAS/GRAPH GOPTIONS statement. You can use these options to control the display. Some of these options produce results that are similar to those for the ODS color parameters. ®
Colors in these options are defined as SAS color names. Refer to SAS 9 documentation for valid examples.
CBACK The CBACK option defines the background color of the graph area.
goptions reset=all device=java xpixels=600 ypixels=400 cback=red;
Chapter 8: Parameters for Colors 183
COLORS The COLORS option specifies the foreground colors. These colors are used if the program does not define the colors elsewhere. In this example, there are three types of grains, but only two colors. In the COLORS option we list only two colors. SAS cycles through the colors defined, repeating as necessary. In our example, this makes corn and wheat use the same color. goptions reset=all device=java xpixels=600 ypixels=400 colors=(purple green);
184 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
CTEXT The CTEXT option specifies the default color for all text and the border. If the CTITLE option is also used, CTITLE overrides the CTEXT option for titles, notes, footnotes, and the border. Other specifications for text in the SAS statements also override the value of CTEXT. When using the CTEXT or CTITLE options, you need to also specify USEGOPT in an ODS statement. goptions reset=all device=java xpixels=600 ypixels=400 ctext=purple ctitle=red; ods listing; ods html close; ODS HTML body=sock rs=none CODEBASE=""; ods usegopt; title "CTEXT and CTITLE GOPTIONS"; proc gchart data=samples.grains; hbar3d country / sumvar=amount; run; quit; ods html close;
CTITLE To specify the title color, you can use the CTITLE option. This option can also specify the color for footnotes, notes and borders. See the section on the CTEXT option for an example.
Chapter 8: Parameters for Colors 185
IBACK The IBACK option defines an image to be used in the background area of the graph space. This option is used in conjunction with the IMAGESTYLE option. In the tested release, this did not work with PROC GCONTOUR.
goptions reset=all device=java xpixels=600 ypixels=400 iback='http://localhost:8095/BBU/images/earth_dim.gif' imagestyle=fit;
IMAGESTYLE The IMAGESTYLE option helps to specify how to display the image used with the IBACK option. This option has two possible values: FIT and TILE. The FIT setting fits the single image to the graphical area. The TILE setting uses the original image size and repeats it to fill the graphical area.
186 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
goptions reset=all device=java xpixels=600 ypixels=400 iback='http://localhost:8095/BBU/images/earth_dim.gif' imagestyle=tile;
8.2.1 Non-supported options Some options for the GOPTIONS statement are not supported by the Java device driver. CBY CPATTERN
The CBY option defines the color of the BY lines. The CPATTERN option specifies the default color for PATTERN definitions.
CSYMBOL
The CSYMBOL option sets the color for the SYMBOL defined.
IMAGEPRINT/ NOIMAGEPRINT OFFSHADOW
The IMAGEPRINT/NOIMAGEPRINT options allow and disallow image output. The OFFSHADOW option controls the height and width of the drop shadow used with the legend frames.
TRANSPARENCY/ NOTRANSPARENCY
The TRANSPARENCY/NOTRANSPARENCY options specify whether or not to display the background of the graphic as transparent.
8.3 PROC GCHART This section covers defining colors by modifying the PROC GCHART parameters. For each parameter, we provide information on what the parameter does, what it looks like, and how to use it. At the end, a summary table shows which options are valid with the various types of charts. The syntax of the parameter is shown in a code box following the example. In all cases, the parameter is coded in the PROC GCHART statement. For the standard graph types, we show only the parameter part of the statement. If the example is an unusual graph, we include the full code and highlight the parameter syntax. The following code is a standard three-dimensional horizontal bar graph. The color parameter is highlighted. proc gchart data=samples.grains; hbar3d country / sumvar=amount cautoref=red autoref; run; quit;
Chapter 8: Parameters for Colors 187
CAUTOREF The CAUTOREF parameter, in conjunction with the AUTOREF parameter, defines the color to use for the reference lines drawn at the major tick marks. In the example, the tick marks are along the x axis denoted by AMOUNT. If CAUTOREF is not defined, the CAXIS parameter value or the first color in the color list is used by default. cautoref=red autoref
CAXIS The CAXIS parameter in the PROC GCHART statement specifies the color for the response and the midpoint axis area frame if there is one. This parameter can also be used to specify the default color for all the reference lines.
caxis=red
188 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
CERROR When the graph uses the error bar options, the CERROR parameter specifies the color of error bars. The default color is the response axis color.
proc gchart data=samples.fitness; hbar3D age / type =mean sumvar=heart discrete frame errorbar=bar clm=95 cerror=red; run; quit;
CFILL The CFILL parameter is used with a threedimensional pie chart to define a single color for all patterns in the pie chart. This option makes all the slices in the pie the same color. The default for a threedimensional pie is a solid fill pattern. The CFILL and FILL parameters can be specified together to produce specified color hatching. With a threedimensional pie chart, the FILL is limited to solid. cfill=red
Chapter 8: Parameters for Colors 189
CFRAME/CFR The CFRAME parameter defines the background color of the filled axis area or the three-dimensional backplane in the threedimensional charts. This parameter can also be defined using the CFR abbreviation.
cframe=red
COUTLINE The COUTLINE parameter, when used with the PROC GCHART statement, defines the color to use for all bar and slice outlines. The default color is the foreground color. You can also specify SAME to match the color of the bars or slices. To define the outline of all bars or bar segments as well as the legend values in the subgroup legend, you can use the COUTLINE parameter.
coutline=red
190 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
CREF/CR The CREF parameter represents the reference line color. This parameter can also be defined using the CR abbreviation.
cref=red autoref
CTEXT The CTEXT parameter specifies the color to use for all text. The CTEXT parameter for PROC GCHART allows you to set the color for all the text on the chart. This text includes the labels, headings, and arrows if they are used.
ctext=red
FILL The FILL parameter specifies the pattern for all slices in the pie chart. The default value is SOLID. This parameter is only partially supported by the Java device driver. It has two options: SOLID or X (which represents the number of times to rotate a hatch pattern).
Chapter 8: Parameters for Colors 191
The SOLID option is the only one supported. See the section on the CFILL parameter for an example of how to fill a pie chart.
INVISIBLE The INVISIBLE parameter enables you to hide one or more values. In this example, the pie slice and the label for the values listed are invisible in the pie chart. The values must exactly match the existing midpoints, including the case of character midpoints. When using multiple values, separate them with a blank space.
invisible='Canada'
MATCHCOLOR The MATCHCOLOR parameter in PROC GCHART sets the label color to match the slice color. This parameter overrides the color defined in the CTEXT parameter.
Matchcolor
192 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
OTHERCOLOR The OTHERCOLOR parameter defines the color to use with pie slices that are defined by the OTHER parameter.
other=50 othercolor=red
8.3.1 Summary The following tables show which parameters can be used with specific types of charts. Chart Type BLOCK DONUT HBAR HBAR3D PIE PIE3D VBAR VBAR3D
CAUTOREF
Chart Type BLOCK DONUT HBAR HBAR3D PIE PIE3D VBAR VBAR3D
CREF
CAXIS
CERROR
CFILL
CFRAME
3
COUTLINE
3 3
3 3
3 3
3 3
3 3
3 3
3 3
3 3
3 3 3 3
3 3 3 3
3 3 CTEXT
3 3 3 3 3 3 3 3
3 3 INVISIBLE
MATCHCOLOR
OTHERCOLOR
3
3
3
3 3
3 3
3 3
Chapter 8: Parameters for Colors 193
8.3.2 Non-supported parameters Some parameters are not supported by the Java device driver. If an alternative is available, it is listed in the description. IFRAME
IMAGESTYLE
The IFRAME parameter specifies an image file to use on the chart frame. If you need to define something like this, consider using the ODS options such as BACKIMAGE, DRAWIMAGE, IMAGEPOSX, and IMAGEPOSY. The IMAGESTYLE parameter defines the way to display the image defined by the IFRAME parameter. Since IFRAME is not supported by the Java device driver, neither is this parameter.
8.4 PROC GCONTOUR The PROC GCONTOUR parameters that affect colors are shown in this section. At the end a summary table shows which options are valid with the various types of charts.
CAUTOHREF The CAUTOHREF parameter, in conjunction with the AUTOHREF parameter, defines the color to use for the reference lines drawn at the major horizontal tick marks. If CAUTOHREF is not defined, the CAXIS parameter value or the first color in the color list is used by default. An example of horizontal reference lines and the CAUTOHREF parameter can be seen in the PROC GPLOT examples.
CAUTOVREF The CAUTOVREF parameter, in conjunction with the AUTOVREF parameter, defines the color to use for the reference lines drawn at the major vertical tick marks. If CAUTOVREF is not defined, the CAXIS parameter value or the first color in the color list is used by default. An example of vertical reference lines and the CAUTOVREF parameter can be seen in the PROC GPLOT examples.
194 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
CAXIS The CAXIS parameter in the PROC GCONTOUR statement specifies the color for the response and the midpoint axis area frame if there is one. This parameter can also be used to specify the default color for all the reference lines. The default color is the second color in the current color list.
proc gcontour data=work.clay; plot x*y=pct_clay / levels=10 to 90 by 5 caxis=yellow; run;
CFRAME/CFR The CFRAME parameter defines the background color of the filled axis area or the three-dimensional backplane. This parameter can also be defined using the CFR abbreviation.
proc gcontour data=work.clay; plot x*y=pct_clay / levels=10 to 90 by 5 cframe=yellow; run;
Chapter 8: Parameters for Colors 195
CHREF/CH The CHREF parameter specifies the color of the reference lines that run perpendicular to the horizontal axis. This parameter can take a single color or a color list. The default color if CHREF is not defined is the value of the CAXIS parameter, if it is defined. Otherwise, it is the first color in the current color list. This parameter can also be defined using the CH abbreviation.
CLEVELS The CLEVELS parameter specifies a color or list of colors to use for the contour lines. The default colors used come from the current color list. In our example, we specified colors to override the defaults. You can give a gradiant appearance to your contours by using this parameter.
From color list
Defined by CLEVELS
proc gcontour data=samples.clay; plot x*y=pct_clay / levels=10 to 90 by 5 clevels='red' 'orange' 'yellow'; run;
196 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
COUTLINE The COUTLINE parameter specifies the color for outlining the filled areas of the plot. This parameter must be used with the PATTERN option; otherwise it is ignored. Without the PATTERN option, the default color is black. With the PATTERN option, the default color is the foreground color or the first color in the current color list.
CTEXT The CTEXT parameter in the PROC GCONTOUR statement specifies the color to use for all text. The default color is taken first from a CTEXT option on the GOPTIONS statement if there is one defined. Otherwise, it is the first color in the current color list.
proc gcontour data=work.clay; plot x*y=pct_clay / levels=10 to 90 by 5 ctext=red; run;
CVREF/CV The CVREF parameter specifies the color of the reference lines that run perpendicular to the vertical axis. This parameter can take a single color or a color list. The default color if CVREF is not defined is the value of the CAXIS parameter, if it is defined. Otherwise, it is the first color in the current color list. This parameter can also be defined using the CV abbreviation.
Chapter 8: Parameters for Colors 197
8.4.1 Summary The following tables show which parameters can be used with a specific type of chart. Chart Type BLOCK
CAUTOHREF
Chart Type BLOCK
COUTLINE
CAUTOVREF
CTEXT
CAXIS
CFRAME
3
3
CHREF
CLEVELS
3
CVREF
3
8.5 PROC GMAP This section covers defining colors by modifying the PROC GMAP parameters. For each parameter, we provide information on what the parameter does, what it looks like, and how to use it. At the end, a summary table shows which options are valid with the various types of charts. The syntax of the parameter is shown in a code box following the example. In all cases, the parameter is coded in the PROC GMAP statement. Only the parameter part of the statement is shown. The following code is a standard map graph. The color parameter is highlighted. proc gmap map=maps.us data=samples.rgnsites; id state; block sites / cblkout=red; run;
198 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
CBLKOUT The CBLKOUT parameter defines the color to use to outline all blocks. The default color if the PATTERN option is used is SAME, or the color of the interior of the blocks. If there is no PATTERN option defined, then the default color is the foreground or the first color in the current color list. This option is not supported when the shape is defined as CYLINDER.
cblkout=red
CEMPTY The CEMPTY parameter defines the outline color to use when an area of the map is empty. (This parameter did not function with the tested release.)
COUTLINE The COUTLINE parameter, when used with the PROC GMAP statement, defines the color to use for all outlines. The default color is the foreground color. You can also specify SAME to use the same interior pattern color.
coutline=red
Chapter 8: Parameters for Colors 199
CTEXT The CTEXT parameter enables you to set the color for all the text on the map.
ctext=red
8.5.1 Summary The following table shows which parameters can be used with specific types of charts. Chart Type BLOCK CHORO PRISM SURFACE
CBLKOUT
3
CEMPTY
COUTLINE
CTEXT
3 3 3
3 3 3
8.6 PROC GPLOT In this section, we look at parameters that you can use to modify colors in PROC GPLOT. At the end, a summary table shows which options are valid with the various types of charts. The syntax of the parameter is shown in a code box following the example. In all cases, the parameter is coded in the PROC GPLOT statement. Each example uses the same basic code to produce the graph. The full procedure statement is shown in the following code box.
200 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
proc gplot data=work.energyPrice; bubble dollars*year=energy / bcolor=red; run;
BCOLOR The BCOLOR parameter defines the color to use for the bubbles in a bubble plot. The default color when BCOLOR is omitted is the first color in the current color list.
bcolor=red
CAUTOHREF The CAUTOHREF parameter is used to define the color of the horizontal reference lines. The default colors are either the value of the CAXIS parameter if it is used, or the first color in the current color list.
autohref cautohref=red
Chapter 8: Parameters for Colors 201
CAUTOVREF The CAUTOVREF parameter is used to define the color of the vertical reference lines. The default colors are either the value of the CAXIS parameter if it is used, or the first color in the current color list.
autovref cautovref=red;
CAXIS/CA The CAXIS or CA parameter in the PROC GPLOT statement specifies the color for the axis and major tick marks. The default color used is the first color in the current color list.
caxis=red
202 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
CFRAME/CFR The CFRAME parameter defines the background color of the filled axis area. This parameter can also be defined using the CFR abbreviation.
cframe=yellow
CHREF/CH Like the CAUTOHREF parameter, the CHREF parameter defines the color to use for the horizontal reference lines. This parameter can use a color list or a single color. This parameter can also be defined using the CH abbreviation.
autohref chref=red
COUTLINE The COUTLINE parameter is used to define the outline color of the filled areas in a plot. (This parameter did not function with the tested release.)
Chapter 8: Parameters for Colors 203
CTEXT/C The CTEXT parameter for PROC GPLOT enables you to set the color for all the text on the chart. This text includes the labels and headings. This parameter can also be defined using the C abbreviation.
ctext=red
CVREF/CV Like the CAUTOVREF parameter, the CVREF parameter defines the color to use for the vertical reference lines. This parameter affects reference lines defined by the AUTOVREF, VREF, or GRID parameters. The CVREF parameter can take a single color or a color list. This parameter can also be defined using the CV abbreviation. autovref cvref=red or cvref=(red blue green)
204 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
8.6.1 Summary The following tables show which parameters can be used with specific types of charts. Chart Type BUBBLE BUBBLE2 PLOT PLOT2 Chart Type BUBBLE BUBBLE2 PLOT PLOT2
BCOLOR
CAUTOHREF
CAUTOVREF
CAXIS
CFRAME
3
3
3 3 3 3
3 3 3 3
3 3 3 3
3 CHREF
COUTLINE
3 3
CTEXT
CVREF
3 3 3 3
3 3 3 3
8.7 PROC G3D This section covers defining colors by modifying PROC G3D parameters. For each parameter, we provide information on what the parameter does, what it looks like, how to use it, and in which of the charts this parameter is valid.
CAXIS The CAXIS parameter in the PROC G3D statement specifies the color to use for all axis lines as well as tick marks. The default color is taken from the second color in the current color list.
proc g3d data=work.hat; plot y*x=z / caxis=red; run;
Chapter 8: Parameters for Colors 205
CTEXT The CTEXT parameter in the PROC G3D statement specifies the color to use for all text. The default color is taken first from a CTEXT option on the GOPTIONS statement if there is one defined. Otherwise, it is the first color in the current color list.
proc g3d data=work.giris; scatter petallen*petalwid=sepallen / ctext=red; run;
8.7.1 Summary The following table shows which parameters can be used with specific types of charts. Chart Type PLOT SCATTER
CAXIS
CTEXT
3 3
3
8.7.2 Non-supported parameters Some parameters are not supported by the Java device driver. CBOTTOM CTOP
Defines the color to use for the bottom of the plot surface. Defines the color to use for the top of the plot surface.
206 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
C h a p t e r
9
Parameters for Text 9.1 ODS Parameters 208 9.1.1 Non-supported parameters 213 9.2 GOPTIONS 214 9.2.1 Non-supported parameters 217 9.3 PROC GCHART 217 9.3.1 Summary 225 9.3.2 Non-supported parameters 226 9.4 PROC GCONTOUR 227 9.4.1 Summary 231 9.5 PROC GMAP 232 9.5.1 Summary 234 9.6 PROC GPLOT 234 9.6.1 Summary 238 9.7 PROC G3D 239 9.7.1 Summary 240
208 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
9.1 ODS Parameters You can use the ODS parameters in this chapter to customize the appearance of text in your graphs. In the ODS statement, the PARAMETERS= option defines parameters to be passed to a Java applet. Not all parameters work with all the applets. In each parameter section, we note where the parameter is applicable. The parameters are specified in the PARAMETERS= option in the ODS HTML statement as name/value pairs. The applet parameter names are not case sensitive. However, some applet parameter values are case sensitive. In this section, we show only the ODS HTML code. To see the ODS statements in context, review the beginning or ending chapters of this book. Full examples are provided in those sections.
LEGENDFIT The LEGENDFIT parameter takes a Boolean value (TRUE or FALSE). These values specify whether the legend should fit within the height of the contourplot area. If you set this parameter to TRUE, then you are telling the applet that the legend must fit within the plot area. If the values for XPIXELS and YPIXELS do not allow enough space, then the legend will not be displayed or will shrink to a size to fit. This example shows a graph size too small to allow room for the legend. This parameter is used only with the Contour applet.
Chapter 9: Parameters for Text 209
By adjusting the XPIXELS and YPIXELS values in the GOPTIONS statement, we have provided enough space in this example for the legend to display.
ODS HTML body=sock rs=none CODEBASE="" parameters=("LEGENDFIT"="TRUE");
LEGENDFONT You can use the LEGENDFONT parameter to define which Java font to use with the legend in the Contour applet. Fonts are limited in SAS when using the Java device driver. This parameter is used only with the Contour applet.
ODS HTML body=sock rs=none CODEBASE="" parameters=("LEGENDFONT"="Courier");
210 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
LEGENDFONTSIZE You can use the LEGENDFONTSIZE parameter to set the font size in the legend. This parameter takes positive numeric values and can be used with a contour plot. To create a better representation of the usage of this parameter, we also used the LEVELS parameter to reduce the number of values in the legend in this example. This parameter is used only with the Contour applet. ODS HTML body=sock rs=none CODEBASE="" parameters=("LEGENDFONTSIZE"="20"); proc gcontour data=work.clay; plot x*y=pct_clay / levels=0 to 100 by 20; run; ods html close; ods listing;
Chapter 9: Parameters for Text 211
MINLEGENDFONTSIZE The MINLEGENDFONTSIZE parameter defines the minimum font size to be used in the legend. This parameter prevents the font from going below a specified value if auto-scaling is used. If the minimum font size cannot be maintained for the legend, then no legend is displayed. Our example shows this. This parameter is used only with the Contour applet. ODS HTML body=sock rs=none CODEBASE="" parameters=("MINLEGENDFONTSIZE"="15");
SHOWLEGEND The SHOWLEGEND parameter takes either a TRUE or FALSE value and defines whether or not the graph should display the legend. This parameter is used only with the Contour applet.
ODS HTML body=sock rs=none CODEBASE="" parameters=("SHOWLEGEND"="FALSE");
212 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
TIPS The TIPS parameter specifies whether to display data tips. There are four valid values: NONE, STATIONARY, TRUE, and FALSE. NONE and STATIONARY can be used with the Graph and Map applets, whereas the TRUE and FALSE values are used with the Contour applet.
ODS HTML body=sock rs=none CODEBASE="" parameters=("TIPS"="STATIONARY");
TIPMODE The TIPMODE parameter can take three values: STANDARD, HTML, and TABULAR. This parameter defines the types of data tips to display. The default value is STANDARD, which displays both HTML and tabular data tips if both are defined. Tabular data tips represent data values, whereas HTML data tips, when used with the HTML option for the graph, can represent HTML text that you can define. Unfortunately, when the Java device driver is used, only the tabular values are displayed.
Chapter 9: Parameters for Text 213
TIPTEXTCOLOR The TIPTEXTCOLOR parameter defines the color to use for data tip fonts. This parameter is used only with the Contour applet.
ODS HTML body=sock rs=none CODEBASE="" parameters=("TIPTEXTCOLOR"="RED");
9.1.1 Non-supported parameters Some parameters are not supported by the Java device driver. FREQNAME
FREQNAME is a parameter used to specify the newly created variable when running frequency charts.
214 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
9.2 GOPTIONS The fonts shown to the right can be used with text options for the GOPTIONS statement and the Java device driver. Although many more fonts are available in SAS, these are the ones that are supported by SAS using Java for display.
FTEXT The FTEXT option specifies the font to use for all text. Some fonts can be used only with certain graphs. For example, Courier is only used with the Graph applet. If you specify a font that is not available, a standard font is substituted by default. A message is shown in the SAS log indicating that a default was substituted.
goptions reset=all device=java xpixels=600 ypixels=400 ftext=courier;
Chapter 9: Parameters for Text 215
FTITLE The FTITLE option defines the font to use with TITLE1. This option must be used with the ODS USEGOPT statement. The default font used is FTEXT if it is defined. Otherwise, SWISS is used as the default.
libname samples ''; filename sock SOCKET ':'; goptions reset=all device=java xpixels=600 ypixels=400 ftitle=courier; ods listing; ods html close; ODS HTML body=sock rs=none CODEBASE=""; ODS USEGOPT; title1 "Proc GChart - Courier Title"; proc gchart data=samples.grains; hbar3d country / sumvar=amount; run; ods html close; ods listing;
216 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
HTEXT The HTEXT option defines the height of the text in the output. The default value is 1. This option is only partially supported by the Java device driver. In most cases, this option worked. In the tested release, when used with PROC GCONTOUR, this option was not applied to the output.
goptions reset=all device=java xpixels=600 ypixels=400 htext=2;
HTITLE The HTITLE option is used to specify the height to use with TITLE1. The default value is HTITLE=2 unless the HTEXT option is used. As with the FTITLE option, the ODS USEGOPT statement must be used.
Chapter 9: Parameters for Text 217
libname samples ''; filename sock SOCKET ':'; goptions reset=all device=java xpixels=600 ypixels=400 htitle=1; ods listing; ods html close; ODS HTML body=sock rs=none CODEBASE=""; ODS USEGOPT; title1 "Proc GChart - Title Height = 1"; proc gchart data=samples.grains; hbar3d country / sumvar=amount; run; ods html close; ods listing;
9.2.1 Non-supported parameters Some parameters are not supported by the Java device driver. FBY
The FBY option specifies the font to be used by the BY statement when using subgroups and graph procedures.
FONTRES
The FONTRES option helps to control the resolution of software fonts in output.
FTRACK
The FTRACK option controls the spacing of the letters in fonts.
HBY
The HBY option is used to specify the height of any BY line text.
9.3 PROC GCHART The following parameters, when used with the SAS procedure GCHART, enable you to modify some of the text that is output with the graph.
218 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
CFREQ You can use the CFREQ parameter to display the cumulative frequency statistic. In vertical bar charts, if the bars are too narrow and the statistic does not have enough space to display, it is suppressed.
proc gchart data=samples.grains; hbar3d country / sumvar=amount cfreq; run;
CPERCENT/CPCT You can use the CPERCENT parameter to display the cumulative percentage statistic. In vertical bar charts, if the bars are too narrow and the statistic does not have enough space to display, it is suppressed. This parameter can be abbreviated as CPCT.
proc gchart data=samples.grains; hbar3d country / sumvar=amount cpercent; run;
Chapter 9: Parameters for Text 219
CTEXT The CTEXT parameter for PROC GCHART enables you to set the color for all the text on the chart. This text includes the labels, headings, and arrows if they are used.
proc gchart data=samples.grains; hbar3d country / sumvar=amount ctext=red; run;
DETAIL_PERCENT The DETAIL_PERCENT parameter, used with the DETAIL parameter, enables you to specify whether or not to display the percentages of the detail pie slices. There are two settings: BEST and NONE. The BEST setting automatically determines the best percentage format to display. The NONE setting omits the percentage altogether.
proc gchart data=samples.grains; pie country / sumvar=amount detail=type detail_percent=best; run;
220 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
DETAIL_SLICE The DETAIL_SLICE parameter determines whether the variable value should be used as a label for the detail part of the pie. There are two settings: BEST and NONE. The BEST setting determines the best format to be used with the slice. The NONE setting suppresses these labels.
proc gchart data=samples.grains; pie country / sumvar=amount detail=type detail_slice=best; run;
DETAIL_VALUE To display the detail slice value information, you can use the DETAIL_VALUE parameter with the DETAIL parameter. There are two settings: BEST and NONE. The BEST setting determines the best format to be used. The NONE setting suppresses the display of the values.
proc gchart data=samples.grains; pie country / sumvar=amount detail=type detail_value=best; run;
Chapter 9: Parameters for Text 221
FREQ The FREQ parameter defines the variable to use as the weight of each observation used in the statistic.
proc gchart data=samples.grains; pie country / sumvar=amount freq=amount; run;
INSIDE The INSIDE parameter displays the specified statistic inside the bar in a bar chart.
proc gchart data=samples.grains; hbar3d country / sumvar=amount inside=percent; run;
222 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
INVISIBLE The INVISIBLE parameter takes a value or a list of values and makes those slices invisible in the pie chart. Labels for these slices are invisible also.
proc gchart data=samples.grains; pie3d country / sumvar=amount invisible='Canada'; run;
MATCHCOLOR The MATCHCOLOR parameter in PROC GCHART sets the label color of the slice to be the same as the slice color. This parameter overrides the color defined in the CTEXT parameter, if used.
proc gchart data=samples.grains; pie3d country / sumvar=amount matchcolor; run;
Chapter 9: Parameters for Text 223
MEAN The MEAN parameter displays the mean statistic above or beside the bars. In vertical bar charts, if the bars are too narrow and the statistic does not have enough space to display, it is suppressed.
proc gchart data=samples.grains; hbar3d country / sumvar=amount mean; run;
OTHERLABEL The OTHERLABEL parameter defines the label to be used for the “Other” slice on a pie chart. The default label is OTHER.
proc gchart data=samples.grains; pie3d country / sumvar=amount other=50 otherlabel="Under 50%"; run;
224 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
OUTSIDE The OUTSIDE parameter displays the specified statistic outside the bar in a bar chart.
proc gchart data=samples.grains; hbar3d country / sumvar=amount outside=percent; run;
PERCENT The PERCENT parameter displays the percentage of observations that have a given value for the chart variable. In vertical bar charts, if the bars are too narrow and the statistic does not have enough space to display, it is suppressed.
proc gchart data=samples.grains; hbar3d country / sumvar=amount percent; run;
Chapter 9: Parameters for Text 225
RANGE The RANGE parameter displays the range of values for each bar. This option works with axes which represent numeric data and has no effect on character data.
proc gchart data=samples.grains; hbar3d year / sumvar=amount range; run;
9.3.1 Summary The following tables show which parameters can be used with specific types of charts. Chart Type BLOCK DONUT HBAR HBAR3D PIE PIE3D STAR VBAR VBAR3D
CFREQ
3 3
3 3
CPERCENT
CTEXT
3 3
3 3 3 3 3 3
3 3
3 3
DETAIL_PERCENT
DETAIL_SLICE
3
3
3
3
226 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
Chart Type BLOCK DONUT HBAR HBAR3D PIE PIE3D STAR VBAR VBAR3D Chart Type BLOCK DONUT HBAR HBAR3D PIE PIE3D STAR VBAR VBAR3D
DETAIL_VALUE
3 3
MEAN
FREQ
INSIDE
3 3 3 3 3 3
3 3
3 3
3 3
OTHERLABEL
OUTSIDE
3 3 3
3 3 3 3
3 3
3 3
INVISIBLE
MATCHCOLOR
3
3
3 3
3 3
PERCENT
3 3 3 3 3 3 3
RANGE
3 3
3 3
9.3.2 Non-supported parameters Some parameters are not supported by the Java device driver. MEANLABEL CFREQLABEL CPERCENTLABEL FREQLABEL PERCENTLABEL
The MEANLABEL parameter used in the GCHART procedure defines the label used for the MEAN statistics in the table of statistics. The CFREQLABEL parameter used in the GCHART procedure defines the label used for the CFREQ statistics in the table of statistics. The CPERCENTLABEL parameter used in the GCHART procedure defines the label used for the CPERCENT statistics in the table of statistics. The FREQLABEL parameter enables the user to define the label that represents FREQ in the table of statistics. The PERCENTLABEL parameter defines the label to use for the PERCENT statistic displayed in the table of statistics.
Chapter 9: Parameters for Text 227
9.4 PROC GCONTOUR The following parameters, when used with the SAS procedure GCONTOUR, enable you to modify some of the text that is output with the graph. Note that in our example graphs a chunk seems to be missing. This is due to missing values in the data and is not an error in the graph.
AUTOLABEL You can use the AUTOLABEL parameter to automatically label the contour lines. The AUTOLABEL suboptions also enable you to customize those labels. The documentation for SAS 9.1.3 says that this parameter is not supported by the Java device.
CTEXT The CTEXT parameter in the PROC GCONTOUR statement specifies the color to use for all text. The default color is taken first from a CTEXT option on the GOPTIONS statement, if there is one defined. Otherwise, it is the first color in the current color list.
proc gcontour data=work.clay; plot x*y=pct_clay / levels=10 to 90 by 5 ctext=red; run;
228 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
HAXIS The HAXIS parameter enables you to apply axis definitions to the horizontal (x) axis of the plot. This parameter must be used in conjunction with a predefined AXIS statement. Also note that the Java device driver does not fully support all AXIS options.
axis1 order=(-10 to 4 by 2); proc gcontour data=work.clay; plot x*y=pct_clay / levels=10 to 90 by 5 haxis=axis1; run;
HREVERSE The HREVERSE parameter specifies that the values along the horizontal axis should be reversed. (This parameter did not function with the tested release.)
Chapter 9: Parameters for Text 229
LEGEND The LEGEND parameter assigns a defined legend specification to the graph. This parameter must be used in conjunction with a predefined LEGEND statement. Not all LEGEND options are supported by the Java device driver.
legend1 label=('Percent Clay'); proc gcontour data=work.clay; plot x*y=pct_clay / levels=10 to 90 by 5 legend=legend1; run;
LEVELS The LEVELS parameter defines the levels to be used on the contour graph.
proc gcontour data=work.clay; plot x*y=pct_clay / levels=10 to 90 by 10; run;
230 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
NOAXIS/NOAXES NOAXIS and NOAXES parameters specify that the graph should not display the axes, axis values, or axis labels. In this example, we have suppressed both.
proc gcontour data=work.clay; plot x*y=pct_clay / levels=10 to 90 by 5 noaxis; run;
NOLEGEND The NOLEGEND parameter suppresses the legend on the graph, as seen in this example.
proc gcontour data=work.clay; plot x*y=pct_clay / levels=10 to 90 by 5 nolegend; run;
Chapter 9: Parameters for Text 231
VAXIS Similar to the HAXIS parameter, the VAXIS parameter enables you to apply axis definitions to the vertical (y) axis of the plot. This parameter must be used in conjunction with a predefined AXIS statement. Also note that the Java device driver does not fully support all AXIS options.
axis1 order=(-10 to 10 by 2); proc gcontour data=work.clay; plot x*y=pct_clay / levels=10 to 90 by 5 vaxis=axis1; run;
VREVERSE The VREVERSE parameter specifies that the values along the vertical axis should be reversed. (This parameter did not function with the tested release.)
9.4.1 Summary The following tables show which parameters can be used with specific types of charts. Chart Type PLOT Chart Type PLOT
AUTOLABEL
CTEXT
HAXIS
3
3
NOAXIS
NOLEGEND
VAXIS
3
3
3
HREVERSE
VREVERSE
LEGEND
LEVELS
3
3
232 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
9.5 PROC GMAP The following parameters, when used with the SAS procedure GMAP, enable you to modify some text that is output with the graph.
CTEXT The CTEXT parameter in the PROC GMAP statement specifies the color to use for all text. The default color is taken first from a CTEXT option on the GOPTIONS statement, if there is one defined. Otherwise, it is the first color in the current color list.
proc gmap map=maps.us data=samples.rgnsites; id state; block sites / ctext=red; run;
LEGEND The LEGEND parameter assigns a defined legend specification to the graph. This parameter must be used in conjunction with a predefined LEGEND statement. Not all LEGEND options are supported by the Java device driver.
Chapter 9: Parameters for Text 233
legend1 label=('Number of Sites'); proc gmap map=maps.us data=samples.rgnsites; id state; block sites / legend=legend1; run;
LEVELS The LEVELS parameter defines the levels to be used on the map.
proc gmap map=maps.us data=samples.rgnsites; id state; block sites / levels=10; run;
NOLEGEND The NOLEGEND parameter suppresses the legend on the graph.
234 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
proc gmap map=maps.us data=samples.rgnsites; id state; block sites / nolegend; run;
9.5.1 Summary The following table shows which parameters can be used with specific types of charts. Chart Type BLOCK CHORO PRISM SURFACE
CTEXT
LEGEND
LEVELS
NOLEGEND
3 3 3
3 3 3
3 3 3
3 3 3
9.6 PROC GPLOT The following parameters, when used with the SAS procedure GPLOT, enable you to modify some text that is output with the graph.
BFONT The BFONT parameter defines the font to use for labeling bubbles in a bubble plot.
proc gplot data=work.energyPrice; bubble dollars*year=energy / blabel bfont="Courier"; run;
Chapter 9: Parameters for Text 235
BLABEL The BLABEL parameter specifies that the third variable should be used to label the bubbles in a bubble plot. By default, the bubbles are not labeled. In this example, the value of ENERGY is displayed.
proc gplot data=work.energyPrice; bubble dollars*year=energy / blabel; run;
CTEXT The CTEXT parameter specifies the color to use for all text. This text includes the labels and headings.
proc gplot data=work.energyPrice; bubble dollars*year=energy / ctext=red; run;
236 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
HAXIS The HAXIS parameter enables you to apply axis definitions to the horizontal (x) axis of the plot. This parameter must be used in conjunction with a predefined AXIS statement. Also note that the Java device driver does not fully support all AXIS options. To utilize this parameter when using BUBBLE2 or PLOT2 statements, put the HAXIS parameter with the BUBBLE or PLOT statement. You cannot specify two different HAXIS parameters within a single PLOT statement.
axis1 order=(1950 to 1990 by 5); proc gplot data=work.energyPrice; bubble dollars*year=energy / haxis=axis1; bubble2 yen*year=energy; run;
HREVERSE The HREVERSE parameter specifies that the values along the horizontal axis should be reversed. Like the HAXIS parameter, you can apply this parameter to a BUBBLE2 or PLOT2 graph. It must be defined in the BUBBLE or the PLOT statements.
Chapter 9: Parameters for Text 237
proc gplot data=work.energyPrice; bubble dollars*year=energy / hreverse; run;
NOAXIS/NOAXES NOAXIS and NOAXES parameters specify that the graph should not display the axes, axis values, or axis labels. Also note that when you want to apply this parameter to a BUBBLE2 or PLOT2 statement, you need to specify this parameter in both statements (i.e., both BUBBLE and BUBBLE2 or both PLOT and PLOT2).
proc gplot data=work.energyPrice; bubble dollars*year=energy / noaxis; bubble2 yen*year=energy / noaxis; run;
VAXIS The VAXIS parameter enables you to apply axis definitions to the vertical (y) axis of the plot. This parameter must be used in conjunction with a predefined AXIS statement. Also note that the Java device driver does not fully support all AXIS options. VAXIS can be applied to either or both the PLOT and PLOT2 or the BUBBLE and BUBBLE2 statements using the same or different AXIS statements.
238 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
axis1 order=(0 to 3 by .5); axis2 order=(100 to 500 by 50); proc gplot data=work.energyPrice; bubble dollars*year=energy / vaxis=axis1; bubble2 yen*year=energy / vaxis=axis2; run;
VREVERSE The VREVERSE parameter specifies that the values along the vertical axis should be reversed.
proc gplot data=work.energyPrice; bubble dollars*year=energy / vreverse; bubble2 yen*year=energy / vreverse; run;
9.6.1 Summary The following tables show which parameters can be used with specific types of charts. Chart Type BUBBLE BUBBLE2 PLOT PLOT2 Chart Type BUBBLE BUBBLE2 PLOT PLOT2
BFONT
BLABEL
CTEXT
HAXIS
HREVERSE
3 3
3 3 3 3
3
3
3
3
NOAXIS
VAXIS
VREVERSE
3 3 3 3
3 3 3 3
3 3 3 3
Chapter 9: Parameters for Text 239
9.7 PROC G3D The following parameters, when used with the SAS procedure G3D, enable you to modify some text that is output with the graph.
CTEXT CTEXT specifies the color to use for all text. This text includes the labels, headings, and arrows if they are used.
proc g3d data=work.giris; scatter petallen*petalwid=sepallen / ctext=red; run;
NOAXES/NOAXIS The NOAXES or NOAXIS parameter specifies that the graph should not display the axis, axis labels, or tick mark values.
240 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
proc g3d data=work.giris; scatter petallen*petalwid=sepallen / noaxis; run;
NOLABEL The NOLABEL parameter specifies that the output should have no axis labels or tick mark values.
proc g3d data=work.giris; scatter petallen*petalwid=sepallen / nolabel; run;
9.7.1 Summary The following table shows which parameters can be used with specific types of charts. Chart Type PLOT SCATTER
CTEXT
NOAXIS
NOLABEL
3
3 3
3 3
C h a p t e r
10
Other Parameters 10.1 PROC GCHART 242 10.1.1 Summary 264 10.1.2 Non-supported parameters 267 10.2 PROC GCONTOUR 268 10.2.1 Non-supported parameters 272 10.3 PROC GMAP 273 10.3.1 Summary 277 10.3.2 Non-supported parameters 278 10.4 PROC GPLOT 278 10.4.1 Summary 289 10.4.2 Non-supported parameters 289 10.5 PROC G3D 290 10.5.1 Summary 298 10.5.2 Non-supported parameters 298
242 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
10.1 PROC GCHART In addition to the parameters that affect text and colors, there are lots of other parameters in PROC GCHART that you can use to improve the appearance of your graphs. These parameters enable you to display charts produced with BY groups, add reference lines, control grouping, and more. Not all parameters apply to every chart type. A table at the end of this section summarizes which parameters can be used with which chart type.
ACROSS The ACROSS parameter draws the specified number of graphs across the output area. This parameter must be used with the GROUP parameter. If the number of graphs will not fit, no graphs are drawn, and a message is sent to the SAS log.
proc gchart data=samples.grains; pie3d country / sumvar=amount group=year across=2; run;
Chapter 10: Other Parameters 243
ANGLE The ANGLE parameter tells the graph object where to start the first slice of a pie chart. Valid values are numeric, with 0 at the 3 o’clock position. A positive value moves the pie slice starting position counterclockwise towards the 12 o’clock position. Negative values move the starting position clockwise towards the 6 o’clock position.
proc gchart data=samples.grains; pie3d country / sumvar=amount angle=10; run;
ASCENDING The ASCENDING parameter arranges the slices or bars in ascending order according to the value of the chart’s statistic. By default they are arranged in ascending order based on midpoint values. The ASCENDING parameter does not affect the position of the OTHER slice or bar. It is always reported last, regardless of size or value. If you use the GROUP parameter, the slices and bars are reordered within each group.
proc gchart data=samples.grains; hbar3d country / sumvar=amount ascending; run;
244 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
AUTOREF The AUTOREF parameter draws reference lines at each major tick mark along the response axis.
proc gchart data=samples.grains; vbar country / sumvar=amount autoref; run;
AXIS/RAXIS The AXIS parameter enables you to apply a specific AXIS to the graph for the major tick mark divisions on the response axis. This parameter must be used in conjunction with a predefined AXIS statement. Also note that the Java device driver does not fully support all AXIS parameters.
axis1 color=red; proc gchart data=samples.grains; vbar3d country / sumvar=amount axis=axis1; run;
Chapter 10: Other Parameters 245
CLIPREF The CLIPREF parameter clips the reference lines at the bars. This gives the appearance of putting the reference lines behind the bars in a chart. This is the default for threedimensional charts, so it only affects twodimensional charts.
proc gchart data=samples.grains; hbar country / sumvar=amount autoref clipref; run;
CLM The CLM parameter specifies the confidence interval to use. Values must be numeric and within the range of 50 to 100. The default is 95.
proc gchart data=samples.fitness; vbar3d age / sumvar=heart type=mean discrete clm=55; run;
246 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
CLOCKWISE The CLOCKWISE parameter draws the slices of a pie or donut chart clockwise, starting at the 12 o’clock position.
proc gchart data=samples.grains; donut country / sumvar=amount clockwise; run;
DESCENDING Similar to the ASCENDING parameter, the DESCENDING parameter arranges the slices in descending order based on the value. The OTHER slice is still positioned last, regardless of its size. If you use the GROUP parameter, the reordering occurs within each group.
proc gchart data=samples.grains; hbar3d country / sumvar=amount descending; run;
Chapter 10: Other Parameters 247
DETAIL The DETAIL parameter produces an inner pie or donut overlay which shows the major subcomponents of the outer slice. This is a way to show a grouping in a single pie chart. If you use the GROUP or SUBGROUP parameters, then this parameter is ignored.
proc gchart data=samples.grains; pie country / sumvar=amount detail=type; run;
DETAIL_RADIUS The DETAIL_RADIUS parameter determines the size of the inner detail pie or donut. This parameter is a percentage of the outer pie’s radius and has valid values between 25 and 90. The default is 75.
proc gchart data=samples.grains; donut country / sumvar=amount detail=type detail_radius=50; run;
248 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
DETAIL_THRESHOLD The DETAIL_THRESHOLD parameter sets a percentage value that specifies whether or not an inner pie slice is to be included. The valid range for this percentage value is 0 to 75. The default is 4.
proc gchart data=samples.grains; donut country / sumvar=amount detail=type detail_threshold=10; run;
DISCRETE The DISCRETE parameter breaks the variable values into discrete values instead of a continuous variable. This creates a pie or bar chart with a separate bar or slice per unique value. The LEVELS parameter is ignored with this parameter, and the MIDPOINTS parameter overrides DISCRETE.
proc gchart data=samples.fitness; pie3d age / discrete sumvar=heart; run;
Chapter 10: Other Parameters 249
DONUTPCT DONUTPCT stands for Donut Percentage. This parameter specifies the size of the donut hole as represented by a percentage of the size of the whole donut. Valid numeric values range from 0 to 99. The default is 25.
proc gchart data=samples.fitness; donut age / sumvar=heart donutpct=50; run;
DOWN The DOWN parameter is similar to the ACROSS parameter in that it specifies how many charts are displayed vertically. This is ignored, however, if you use it with the GROUP parameter. Also, if the number specified does not fit vertically in the graphics area of the output, no charts are drawn, and an error is recorded in the SAS log. Note that when you have more groups, the pies are added across while the number of down pies is maintained.
proc gchart data=samples.grains; pie country / sumvar=amount group=type down=2; run;
250 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
ERRORBAR The ERRORBAR parameter draws confidence intervals on the bar chart. This parameter is normally used with the CLM parameter, which has a default of 95 for the confidence level. The ERRORBAR parameter takes three values: BARS, BOTH, or TOP. In this example, we used the BARS value, which created a half-width bar that is placed on top. Use BOTH to draw two tick marks joined by a line that is placed on top. TOP draws a single tick mark and a line from the end of the bar to the mark.
proc gchart data=samples.fitness; hbar age / sumvar=heart type=mean discrete clm=55 errorbar=bar; run;
EXPLODE The EXPLODE parameter pulls a specified slice away from the pie or donut chart. This parameter can take a value list and must match the existing midpoints exactly, including the case of character midpoints. When you use the EXPLODE parameter, the overall radius is reduced on the pie or donut to accommodate the exploded slice. This parameter does not work with the SUBGROUP parameter.
proc gchart data=samples.grains; donut country / sumvar=amount explode='Canada'; run;
Chapter 10: Other Parameters 251
FRAME/NOFRAME FR/NOFR The FRAME or FR parameter tells the graph to display the frame that is drawn around the backplane or axis area. The NOFRAME or NOFR parameter tells the graph not to display the frame. The default is to show the frame. In this example, we have used NOFRAME to suppress the frame.
proc gchart data=samples.fitness; hbar3d age / noframe sumvar=heart; run;
FRONTREF The FRONTREF parameter is used to specify that reference lines be drawn in front of the bars. By default, the reference lines of threedimensional bar charts are drawn on the back plane.
proc gchart data=samples.grains; vbar country / sumvar=amount autoref frontref; run;
252 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
G100 The G100 parameter calculates the percentage and cumulative percentage statistics separately for each group. This parameter is ignored unless used with the GROUP parameter.
proc gchart data=samples.fitness; block teacher / group=sex type=percent subgroup=teacher g100; run;
GAXIS The GAXIS parameter enables you to assign a defined AXIS statement to the group axis.
axis1 color=cyan; proc gchart data=samples.grains; hbar country / sumvar=amount group=year gaxis=axis1; run;
Chapter 10: Other Parameters 253
GROUP The GROUP parameter organizes the data according to the values from the specified variable. The GROUP parameter can use either character or numeric variable values and treats each as discrete values.
proc gchart data=samples.grains; pie3d country / sumvar=amount group=year; run;
GSPACE The GSPACE parameter adjusts the amount of space between grouped bars, adding extra space. The value of the GSPACE parameter can be any nonnegative number and is expressed as character cells. To use this parameter you must define a group. If the defined GSPACE parameter cannot be maintained due to output space restrictions, the graph is not displayed, and an error is written to the SAS log. Use GSPACE=0 to leave no extra space. proc gchart data=samples.grains; vbar3d country / sumvar=amount group=year gspace=0; run;
254 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
LAUTOREF The LAUTOREF parameter defines the line types to use for reference lines at major tick marks defined by the AUTOREF parameter. Valid values for the LAUTOREF parameter include any whole number between 1 and 46, where 1 is a solid line and the rest are variations of dashed lines. ®
See the SAS 9 online documentation for examples of the line types. proc gchart data=samples.grains; hbar country / sumvar=amount autoref lautoref=15; run;
LEGEND Like the AXIS parameter, the LEGEND parameter enables you to define a LEGEND statement and then apply that to the graph. Be aware, though, that the Java device driver does not support all LEGEND statement parameters.
proc gchart data=samples.fitness; vbar3d teacher / group=sex type=percent subgroup=teacher legend=legend1; run;
Chapter 10: Other Parameters 255
LEVELS The LEVELS parameter specifies the number of midpoints for a numeric chart variable. The midpoint values are calculated automatically based on how many levels you specify.
proc gchart data=samples.fitness; pie age / sumvar=heart levels=4; run;
MAXIS The MAXIS parameter is similar to the GAXIS parameter. This parameter assigns a defined AXIS to the midpoint axis. Be aware, though, that the Java device driver does not support all AXIS statement parameters.
axis1 color=cyan; proc gchart data=samples.grains; hbar3d country / sumvar=amount maxis=axis1; run;
256 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
MIDPOINTS The MIDPOINTS parameter specifies values to use for the bars. It can take a value list that includes either a single value, a set of defined values, or a pattern of values.
proc gchart data=samples.fitness; block age / sumvar=exer midpoints=(20 to 50 by 5); run
MIDPOINTS=OLD The MIDPOINTS=OLD parameter setting generates default midpoints using the Nelder algorithm. For more information on this setting, ® review the SAS 9 online documentation and look for the algorithms description section.
proc gchart data=samples.fitness; block age / sumvar=exer midpoints=old; run;
Chapter 10: Other Parameters 257
MISSING The MISSING parameter allows missing values to be a valid midpoint in the chart. By default, missing values are ignored in bar and pie charts.
proc gchart data=samples.fitness; pie3d age / sumvar=exer missing; run;
NOAXES The NOAXES parameter suppresses all axes, axis lines, axis labels, axis values, and tick marks.
proc gchart data=samples.grains; vbar3d country / sumvar=amount noaxes; run;
258 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
NOGROUPHEADING Group headings are normally printed above each pie when used with the GROUP parameter. You can suppress these headings by using the NOGROUPHEADING parameter.
proc gchart data=samples.grains; pie country / sumvar=amount group=year nogroupheading; run;
NOHEADING The NOHEADING parameter suppresses the heading that is normally printed at the top of each page. This is the default for the Java device driver and is therefore not needed in our examples.
NOLEGEND The NOLEGEND parameter enables you to suppress the legend normally generated when you specify a SUBGROUP parameter.
proc gchart data=samples.fitness; block teacher / group=sex type=percent subgroup=teacher nolegend; run;
Chapter 10: Other Parameters 259
OTHER To lump many values or a value range into one group, use the OTHER parameter. This parameter determines if the value is less than or equal to that percentage of total. The default value is 4 percent. This slice or bar always appears last in the chart, regardless of any order specification.
proc gchart data=samples.fitness; donut teacher / sumvar=exer other=20; run;
PATTERNID The PATTERNID parameter specifies the way PATTERN statements are assigned to bars or slices. It can take values such as BY, GROUP, MIDPOINT, or SUBGROUP. This parameter tells the display to use a different PATTERN based on the value passed to the PATTERNID parameter. For example, if you want a different color for each group defined, use the PATTERNID=GROUP setting. proc gchart data=samples.grains; vbar country / sumvar=amount group=year patternid=group; run;
260 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
RAXIS/AXIS See the description for the AXIS parameter.
REF To draw a reference line at a specific point or points on the response axis, use the REF parameter. This parameter can take a value list that must be within the range of values in the data. If, however, the range specifies a point outside of this range, then a warning is written to the SAS log and no reference line is drawn for that point.
proc gchart data=samples.grains; vbar3d country / sumvar=amount group=year ref=200000; run;
Chapter 10: Other Parameters 261
SHAPE Bar charts can take different shapes for their bars. To specify the shape, use the SHAPE parameter with the following values: BLOCK (B), CYLINDER (C), HEXAGON (H), PRISM (P), or STAR (S).
proc gchart data=samples.grains; block country / sumvar=amount group=year shape=star; run;
SLICE The SLICE parameter controls the position and style of the slice name. Valid values are ARROW, INSIDE, NONE, and OUTSIDE (default).
proc gchart data=samples.fitness; pie3d teacher / sumvar=exer slice=inside; run;
262 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
SPACE To modify the amount of space between each bar, use the SPACE parameter. The SPACE parameter takes any non-negative number as its value. By default, the procedures calculate the best spacing to use based on the number of midpoints and the size of the output area. In our example using SPACE=0, there is no space between the country bars in each year group. proc gchart data=samples.grains; hbar country / sumvar=amount group=year space=0; run;
SUBGROUP To divide the bars into segments, use the SUBGROUP parameter to specify the variable to be subdivided. By default, each subgroup is assigned a different color, and a legend is shown for each discrete value in the subgroup variable. To make the bars all the same color and suppress the legend, use the PATTERNID parameter and specify anything other than the keyword SUBGROUP. You can suppress the legend with the NOLEGEND parameter.
Chapter 10: Other Parameters 263
proc gchart data=samples.fitness; block teacher / group=sex type=percent subgroup=age; run;
SUMVAR You can use the SUMVAR parameter to specify the numeric variable to use for sum or mean calculations.
proc gchart data=samples.fitness; vbar3d teacher / sumvar=exer; run;
TYPE The TYPE parameter specifies the statistic to produce for the chart. Valid values are FREQ, CFREQ, PERCENT/PCT, or CPERCENT/CPCT. If the SUMVAR parameter is used, then SUM and MEAN can also be used as values.
proc gchart data=samples.fitness; donut teacher / type=freq; run;
264 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
WIDTH The WIDTH parameter defines the width to use for each bar in a bar chart. By default, the procedure automatically calculates a good value to use to accommodate the midpoint values displayed. This parameter can take a numeric value, including decimal points, from numbers greater than 0. If the width is too wide to enable all bars to be displayed, the procedure will fall back to the calculated width and write an error to the SAS log. proc gchart data=samples.fitness; vbar3d teacher / width=5; run;
10.1.1 Summary The following tables show which parameters can be used with specific types of charts. Chart Type BLOCK DONUT HBAR HBAR3D PIE PIE3D STAR VBAR VBAR3D
ACROSS
ANGLE
ASCENDING
3
3
3 3 3 3 3
3 3
3 3
3 3
AUTOREF
AXIS
3 3
3 3
3 3
3 3
Chapter 10: Other Parameters 265
Chart Type BLOCK DONUT HBAR HBAR3D PIE PIE3D STAR VBAR VBAR3D
CLIPREF
3
CLM
CLOCKWISE
DESCENDING
DETAIL
3
3 3 3 3 3
3
3 3 3 3
3
3 3
3
3 3
Chart Type BLOCK DONUT HBAR HBAR3D PIE PIE3D STAR VBAR VBAR3D
DETAIL_RADIUS
DETAIL_THRESHOLD
3
3
3
3
Chart Type BLOCK DONUT HBAR HBAR3D PIE PIE3D STAR VBAR VBAR3D
DOWN
DISCRETE
3 3 3 3 3 3
DONUTPCT
3
3 3 ERRORBAR
3
EXPLODE
FRAME
FREQ
3 3
3 3 3 3 3 3
3 3
3 3
3 3 3
3 3
3 3 3 3
266 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
Chart Type BLOCK DONUT HBAR HBAR3D PIE PIE3D STAR VBAR VBAR3D
FRONTREF
G100
GAXIS
GROUP
GSPACE
3
3
3 3
3 3
3 3
3 3 3 3 3 3
3 3
3 3
3 3
3 3
3 3
3 3
Chart Type BLOCK DONUT HBAR HBAR3D PIE PIE3D STAR VBAR VBAR3D
LAUTOREF
LEGEND
LEVELS
MAXIS
MIDPOINTS
3 3 3 3 3 3
3
3 3
3 3 3 3 3 3
3 3
3 3 3 3 3 3
3 3
3 3
3 3
3 3
3 3
Chart Type BLOCK DONUT HBAR HBAR3D PIE PIE3D STAR VBAR VBAR3D
MISSING
NOAXES
NOGROUPHEADING
3 3 3 3 3 3
3 3
3 3
3 3
3 3 3
NOLEGEND
3 3 3 3 3 3 3 3
Chapter 10: Other Parameters 267
Chart Type BLOCK DONUT HBAR HBAR3D PIE PIE3D STAR VBAR VBAR3D
OTHER
Chart Type BLOCK DONUT HBAR HBAR3D PIE PIE3D STAR VBAR VBAR3D
PATTERNID
REF
3
SHAPE
SLICE
3
3
3 3 3
3 3
3
3 3
3 3 3 3
3 3
SPACE
SUBGROUP
SUMVAR
TYPE
WIDTH
3 3
3 3 3 3 3 3
3 3 3 3 3 3
3 3 3 3 3 3
3 3
3 3
3 3
3 3
3 3
3 3
3
10.1.2 Non-supported parameters Some parameters are not supported by the Java device driver. BLOCKMAX
The BLOCKMAX parameter specifies the chart value of the tallest block.
LREF
The LREF and LR parameters specify the line types to use for reference lines.
NOBASEREF
The NOBASEREF parameter suppresses the zero reference line when the SUM or MEAN statistic contains negative values.
NOSTATS
The NOSTATS parameter suppresses the table of statistics.
NOZERO
The NOZERO parameter suppresses any midpoints where there are no corresponding values.
WOUTLINE
The WOUTLINE parameter specifies the width of the outline of bars.
268 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
10.2 PROC GCONTOUR In this section, we look at other parameters in PROC GCONTOUR that can modify the appearance of your graph.
HMINOR/HM To explicitly set the number of minor tick marks, use the HMINOR parameter.
proc gcontour data=work.clay; plot x*y=pct_clay / levels=10 to 90 by 5 hminor=2; run;
Chapter 10: Other Parameters 269
JOIN The JOIN parameter combines adjacent grid cells displayed with the same pattern to form a single pattern area. This parameter is used with the PATTERN parameter.
proc gcontour data=work.clay; plot x*y=pct_clay / levels=10 to 90 by 5 pattern join; run;
NLEVELS The NLEVELS parameter specifies the number of contour levels to display. Valid numeric values can range from 1 to 100. The default is 7.
proc gcontour data=work.clay; plot x*y=pct_clay / levels=10 to 90 by 5 nlevels=10; run;
270 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
NOFRAME The NOFRAME parameter suppresses the frame drawn around the plot area. The output may be subtle on a Windows platform.
axis1 color=green; proc gcontour data=work.clay; plot x*y=pct_clay / levels=10 to 90 by 5 noframe haxis=axis1; run;
PATTERN The PATTERN parameter tells the procedure to use fill patterns and colors for the contour areas. The levels then are represented by rectangles filled with patterns.
proc gcontour data=work.clay; plot x*y=pct_clay / levels=10 to 90 by 5 pattern; run;
Chapter 10: Other Parameters 271
VMINOR/VM The VMINOR parameter is similar to the HMINOR parameter. This parameter specifies the number or minor tick marks along the vertical axis.
proc gcontour data=work.clay; plot x*y=pct_clay / levels=10 to 90 by 5 vminor=2; run;
XTICKNUM The XTICKNUM parameter specifies the number of major tick marks located along the x axis. The value given for this parameter must be greater than 2. The default is 5.
proc gcontour data=work.clay; plot x*y=pct_clay / levels=10 to 90 by 5 xticknum=3; run;
272 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
YTICKNUM Similar to the XTICKNUM parameter, the YTICKNUM parameter defines the number of major tick marks along the y axis. As with XTICKNUM, the value must be greater than 2. The default is 5.
proc gcontour data=work.clay; plot x*y=pct_clay / levels=10 to 90 by 5 yticknum=3; run;
10.2.1 Non-supported parameters Some parameters are not supported by the Java device driver. If an alternative is available, it is listed in the description. AUTOHREF
The AUTOHREF parameter displays reference lines at the major tick marks on the horizontal axis.
AUTOVREF
Similar to the AUTOHREF parameter, the AUTOVREF parameter draws the reference lines along the vertical axis.
GRID
As a shortcut to using both AUTOHREF and AUTOVREF, you can use the GRID parameter to display the reference lines on both the horizontal and vertical axes.
HREF
You can use the HREF parameter to draw reference lines perpendicular to the horizontal axis at points specified by a value list.
LAUTOHREF
The LAUTOHREF parameter defines the line type to use for reference lines drawn at the major tick marks along the horizontal axis.
LAUTOVREF
Similar to the LAUTOHREF parameter, the LAUTOVREF parameter defines the line type used with reference lines along the vertical axis at the major tick marks.
Chapter 10: Other Parameters 273
LHREF
Similar to the LAUTOHREF parameter, the LHREF parameter specifies the line type to use for reference lines along the horizontal axis.
LLEVELS
The LLEVELS parameter defines line types for contour lines.
LVREF
Like the LHREF parameter, the LVREF parameter specifies the line type for use with reference lines along the vertical axis.
VREF
The VREF parameter draws reference lines perpendicular to the vertical axis where specified by the value list.
10.3 PROC GMAP In this section, we look at other parameters in PROC GMAP that can modify the appearance of maps.
AREA The AREA parameter defines different map patterns to be used for the surface of each map area or group of areas. Numeric values that represent a variable in the ID statement can be used as the value set by the AREA parameter. If the ID statement has only one map area, then use AREA=1 to indicate that each map area should use a different pattern. If you have more than one variable, then the numeric value indicates which variable to use by position in the ID statement.
proc gmap map=maps.us data=samples.rgnsites; id state; block sites / area=1; run; quit;
274 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
BLOCKSIZE The BLOCKSIZE parameter specifies the width of the blocks in a BLOCK map. The unit for width is based on the character cell width for the Java device. By default, this width is 2.
proc gmap map=maps.us data=samples.rgnsites; id state; block sites / blocksize=5; run;
DISCRETE The DISCRETE parameter tells the mapping device to use the numeric response variable as though it has discrete values rather than continuous values. This means the response variable is not grouped into ranges.
proc gmap map=maps.us data=samples.rgnsites; id state; prism sites / discrete; run;
Chapter 10: Other Parameters 275
MIDPOINTS The MIDPOINTS parameter defines the response levels for the range of response values. This parameter can take a single numeric value or a value list. When you use this parameter with the Java device driver, only the midpoints that fall into a range are used. So in our example, the ranges are offset to start with 4 because there are no values for 1, 2, or 3.
proc gmap map=maps.us data=samples.rgnsites; id state; choro sites / midpoints=(1 to 100 by 20); run;
MISSING The MISSING parameter enables you to display and define missing values as a valid level for the response variable.
276 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
proc gmap map=maps.us data=samples.rgnsites; id state; prism sites / missing; run;
SHAPE The SHAPE parameter specifies the shape of the blocks in a BLOCK map. The following are valid shapes: BLOCK (B), CYLINDER (C), HEXAGON (H), PRISM (P), and STAR (S).
proc gmap map=maps.us data=samples.rgnsites; id state; block sites / shape=s; run;
Chapter 10: Other Parameters 277
XVIEW/YVIEW/ZVIEW The XVIEW, YVIEW, and ZVIEW parameters are used to define the viewing position for the map. The default values are XVIEW=0.5, YVIEW=2, and ZVIEW=3. When you use these parameters with the Java device driver, you are only able to use and change the values for XVIEW and YVIEW. ZVIEW is set to the default.
proc gmap map=maps.us data=samples.rgnsites; id state; block sites / xview=0 yview=.75; run;
10.3.1 Summary The following tables show which parameters can be used with specific types of charts. Chart Type BLOCK CHORO PRISM SURFACE
AREA
BLOCKSIZE
DISCRETE
MIDPOINTS
MISSING
3
3
3 3 3
3 3 3
3 3 3
Chart Type BLOCK CHORO PRISM SURFACE
SHAPE
XVIEW/YVIEW/ZVIEW
3
3 3 3
3
278 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
10.3.2 Non-supported parameters Some parameters are not supported by the Java device driver. If an alternative is available, it is listed in the description. WOUTLINE
The WOUTLINE parameter defines the width to use for the outline of all block and map areas
XLIGHT YLIGHT
The XLIGHT and YLIGHT parameters specify the coordinates of the light source.
XSIZE YSIZE
The parameters XSIZE and YSIZE define the dimensions of the map.
10.4 PROC GPLOT In this section, we look at other parameters in PROC GPLOT that include ways to modify the axis, legend, reference lines, and other aspects of the plot.
AREAS The AREAS parameter fills all the areas below plot lines with a pattern. This parameter takes a numeric value that indicates which area to fill. The number 1 fills the first area. The number 2 fills both the first and second areas. To use a connected border line to define the area, use a SYMBOL statement with the INTERPOL option.
symbol1 interpol=join; proc gplot data=work.energyPrice; plot dollars*year / areas=2; plot2 yen*year /areas=2; run;
Chapter 10: Other Parameters 279
AUTOHREF The AUTOHREF parameter draws reference lines at all major tick marks along the horizontal axis.
proc gplot data=work.energyPrice; bubble dollars*year=energy / autohref; bubble2 yen*year=energy / autohref; run;
AUTOVREF Similar to the AUTOHREF parameter, the AUTOVREF parameter draws reference lines at all the major tick marks along the vertical axis.
proc gplot data=work.energyPrice; bubble dollars*year=energy / autovref; bubble2 yen*year=energy / autovref; run;
280 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
BSCALE The BSCALE parameter defines whether the bubbles in a bubble plot are proportioned based on AREA or RADIUS. When you use AREA, the larger bubble is twice the area of the smaller bubble. When you use RADIUS, the larger bubble is twice the radius of the smaller bubble, which makes the larger bubble four times the area of the smaller bubble.
proc gplot data=work.energyPrice; bubble dollars*year=energy / bscale=area; bubble2 yen*year=energy / bscale=radius; run;
BSIZE You can set the bubble size using the BSIZE parameter. The value to use with BSIZE is a numeric which represents the scaling factor. The default bubble size is 5.
proc gplot data=work.energyPrice; bubble dollars*year=energy / bsize=20; run;
Chapter 10: Other Parameters 281
FRAME/NOFRAME FR/NOFR The FRAME or FR parameter specifies that the frame is to be drawn around the axis area. To suppress the frame, use the NOFRAME or NOFR parameter.
proc gplot data=work.energyPrice; bubble dollars*year=energy / noframe; run;
GRID The GRID parameter specifies that reference lines appear at all major tick marks on both axes.
proc gplot data=work.energyPrice; bubble dollars*year=energy / grid; bubble2 yen*year=energy / grid; run;
282 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
HMINOR/HM The HMINOR or HM parameter enables you to define the number of minor tick marks to be drawn between each major tick mark along the horizontal axis.
proc gplot data=work.energyPrice; bubble dollars*year=energy / hminor=2 bcolor=black; run;
HREF The HREF parameter enables you to define the values to use for reference lines perpendicular to the horizontal axis.
proc gplot data=work.energyPrice; bubble dollars*year=energy / href=1980 bcolor=black; run;
Chapter 10: Other Parameters 283
HZERO The HZERO parameter sets the horizontal axis to begin with zero instead of using the first data value. This parameter is ignored if negative values exist in the data.
proc gplot data=work.energyPrice; bubble dollars*year=energy / hzero; run;
LAUTOHREF The LAUTOHREF parameter specifies a line type to use with reference lines drawn at major tick marks along the horizontal axis. This parameter can take numeric values within the range of 1 to 46, where 1 is a solid line.
proc gplot data=work.energyPrice; bubble dollars*year=energy / autovref lautohref=10 bcolor=black; run;
284 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
LAUTOVREF Similar to the LAUTOHREF parameter, the LAUTOVREF parameter defines the line type to be used for reference lines along the vertical axis. These values can be any numeric between 1 and 46. Notice how the line types are different to help define visually which lines are reference lines for dollars and which are for yen.
proc gplot data=work.energyPrice; bubble dollars*year=energy / autovref lautovref=15; bubble2 yen*year=energy / autovref lautovref=40; run;
LEGEND The LEGEND parameter enables you to apply a predefined LEGEND to the plot. In our testing we got unexpected results with SAS 9.1.3. This example uses PLOT2 in the form of x*y=z.
legend1 cborder=red; proc gplot data=work.energyPrice; plot dollars*year=dollars / legend=legend1; plot2 yen*year=yen /legend=legend1; run;
Chapter 10: Other Parameters 285
LHREF / LH The LHREF parameter is similar to the LAUTOHREF parameter in that it specifies the line types to be used for reference lines drawn perpendicular to the horizontal axis. The values can range from 1 to 46, where 1 is a solid line and is the default. Unlike the LAUTOHREF parameter, this parameter can also take a value list to specify a set of line types to use.
proc gplot data=work.energyPrice; bubble dollars*year=energy / autohref lhref=15; run;
LVREF / LV Like the LHREF parameter, the LVREF parameter specifies the line types to use and can take a value list. However, LVREF is used to define the reference lines perpendicular to the vertical axis. It can take numeric values ranging from 1 to 46.
proc gplot data=work.energyPrice; bubble dollars*year=energy / autovref lvref=15 bcolor=black; bubble2 yen*year=energy / autovref lvref=40 bcolor=grey; run;
286 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
NOLEGEND The NOLEGEND parameter suppresses the legend that is automatically generated by plots in the form of x*y=z.
proc gplot data=work.energyPrice; plot dollars*year=energy / nolegend; run;
OVERLAY The OVERLAY parameter places all plots generated by the PLOT statement on one axis. In the tested release, this parameter did not work with plots in the form of x*y=z.
SKIPMISS The SKIPMISS parameter breaks a plot line or an area where there are missing values of the Y variable.
Chapter 10: Other Parameters 287
data a; input id x y; cards; 0 5 8 1 4 7 2 . 8.1 3 10 . 4 5 7.5 5 . 8 6 2 9 7 3 10 8 12 9 ; run; proc gplot data=a; symbol1 interpol=join v=dot; plot x*id=1 / skipmiss; plot2 y*id=1 / skipmiss; run;
VMINOR/VM The VMINOR or VM parameter is similar to the HMINOR parameter. It specifies the number of minor ticks drawn between the major tick marks along the vertical axis.
proc gplot data=work.energyPrice; bubble dollars*year=energy / vminor=2; run;
288 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
VREF The VREF parameter draws one or more reference lines perpendicular to the vertical axis at points specified in the value list.
proc gplot data=work.energyPrice; bubble dollars*year=energy / vref=2; run;
VZERO Similar to the HZERO parameter, the VZERO parameter redefines the vertical axis and sets it to start at 0.
proc gplot data=work.energyPrice; plot dollars*year / vzero; plot2 yen*year / vzero; run;
Chapter 10: Other Parameters 289
10.4.1 Summary The following tables show which parameters can be used with specific types of charts. Chart Type BUBBLE BUBBLE2 PLOT PLOT2
AREAS
AUTOREF
AUTOVREF
BSCALE
BSIZE
3 3 3 3
3 3
3 3
3 3
3 3 3 3
Chart Type BUBBLE BUBBLE2 PLOT PLOT2
FRAME
GRID
HMINOR
HREF
HZERO
3 3 3 3
3 3 3 3
3
3
3
3
3
3
LAUTOHREF
LAUTOVREF
LEGEND
3
3 3 3 3
3 3
OVERLAY
SKIPMISS
VMINOR
VREF
3 3
3 3 3 3
3 3 3 3
Chart Type BUBBLE BUBBLE2 PLOT PLOT2
3
Chart Type BUBBLE BUBBLE2 PLOT PLOT2
NOLEGEND
Chart Type BUBBLE BUBBLE2 PLOT PLOT2
VZERO
3 3
3 3
LHREF
LVREF
3
3 3 3 3
3
3 3 3 3
10.4.2 Non-supported parameters Some parameters are not supported by the Java device driver. If an alternative is available, it is listed in the description.
290 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
IFRAME
The IFRAME parameter specifies an image file to use on the chart frame. If you need to define something like this, consider using the ODS parameters such as BACKIMAGE, DRAWIMAGE, IMAGEPOSX, and IMAGEPOSY.
IMAGESTYLE
The IMAGESTYLE parameter helps to define how to display the image defined by IFRAME.
REGEQN
The REGEQN parameter displays the regression equation that is specified in the INTERPOL parameter of the SYMBOL statement.
10.5 PROC G3D This section covers the other parameters available with PROC G3D that you can use to control the graph image.
GRID The GRID parameter specifies whether to draw reference lines at the major tick marks on all axes.
data work.giris; set samples.giris; do i=1 to _n_; if sepallen > 70 then datacolor="CX33FFFF"; else datacolor="CXFF3333"; output; end; run; proc g3d data=work.giris; scatter petallen*petalwid=sepallen / grid; run;
Chapter 10: Other Parameters 291
NONEEDLE The NONEEDLE parameter specifies that a scatter plot have no lines that connect the shape to the x-y plane. By definition, PILLER and PRISM shapes connect to the floor, so the NONEEDLE parameter has no effect when they are used.
data work.giris; set samples.giris; do i=1 to _n_; if sepallen > 70 then datacolor="CX33FFFF"; else datacolor="CXFF3333"; output; end; run; proc g3d data=work.giris; scatter petallen*petalwid=sepallen / noneedle; run;
ROTATE The ROTATE parameter defines the angles used to rotate the plot about the z axis. The default value is 70, which represents an angle in degrees. You can also specify numeric values greater than 360 or negative numbers.
292 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
data work.hat ; do x = -5 to 5 ; do y = -5 to 5 ; z = sin(sqrt( x*x + y*y )) ; output ; end; end; run; proc g3d data=work.hat; plot y*x=z / rotate=15; run;
SHAPE The SHAPE parameter defines the symbol to use with a scatter plot. Valid values include BALLOON, CLUB, CROSS, CUBE, CYLINDER, DIAMOND, FLAG, HEART, PILLER, POINT, PRISM, PYRAMID, SPADE, SQUARE, and STAR. You can also use a variable as a valid value. This variable would contain one of the values of SHAPE listed above to use with the data point. This allows you to assign different shapes to different data points in the same graph.
data work.giris; set samples.giris; do i=1 to _n_; if sepallen > 70 then datacolor="CX33FFFF"; else datacolor="CXFF3333"; output; end; run; proc g3d data=work.giris; scatter petallen*petalwid=sepallen / shape="balloon" size=2; run;
Chapter 10: Other Parameters 293
SIDE You can use the SIDE parameter to produce a surface graph with side walls.
data work.hat ; do x = -5 to 5 ; do y = -5 to 5 ; z = sin(sqrt( x*x + y*y )) ; output ; end; end; run; proc g3d data=work.hat; plot y*x=z / side; run;
SIZE The SIZE parameter enables you to specify the relative size of the shape on a scatter plot. The relative size is an order of magnitude greater than the default of SIZE=1.0. Therefore, if you specify SIZE=2 then the shapes will be two times larger than the default. As with the SHAPE parameter, you can also specify a variable to define the size of each shape depending on the data point.
294 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
data work.giris; set samples.giris; do i=1 to _n_; if sepallen > 70 then datacolor="CX33FFFF"; else datacolor="CXFF3333"; output; end; run; proc g3d data=work.giris; scatter petallen*petalwid=sepallen / shape="balloon" size=2; run;
TILT The TILT parameter specifies one or more angles used to tilt the graph towards the viewer. The default is 70. Unlike the values of the ROTATE parameter, these values must be between 0 and 90.
data work.hat ; do x = -5 to 5 ; do y = -5 to 5 ; z = sin(sqrt( x*x + y*y )) ; output ; end; end; run; proc g3d data=work.hat; plot y*x=z / tilt=15; run;
Chapter 10: Other Parameters 295
XTICKNUM The XTICKNUM parameter defines the number of major tick marks located on the x axis. The values must be 2 or greater. The default is 4.
data work.hat ; do x = -5 to 5 ; do y = -5 to 5 ; z = sin(sqrt( x*x + y*y )) ; output ; end; end; run; proc g3d data=work.hat; plot y*x=z / xticknum=3; run;
YTICKNUM The YTICKNUM parameter defines the number of major tick marks located on the y axis. The values must be 2 or greater. The default is 4.
296 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
data work.hat ; do x = -5 to 5 ; do y = -5 to 5 ; z = sin(sqrt( x*x + y*y )) ; output ; end; end; run; proc g3d data=work.hat; plot y*x=z / yticknum=3; run;
ZTICKNUM The ZTICKNUM parameter defines the number of major tick marks located on the z axis. The values must be 2 or greater. The default is 4.
data work.giris; set samples.giris; do i=1 to _n_; if sepallen > 70 then datacolor="CX33FFFF"; else datacolor="CXFF3333"; output; end; run; proc g3d data=work.giris; scatter petallen*petalwid=sepallen / zticknum=3; run;
Chapter 10: Other Parameters 297
ZMAX/ZMIN The ZMAX and ZMIN parameters are used to specify the maximum and minimum values to display on the z axis. By default, these values are set based on the data. If you define the parameters to be outside of the minimum and maximum values, the z axis is extended. In this example, you can see that there are significantly fewer points than in the previous graph, which used the same data and did not set a ZMIN or ZMAX parameter. data work.giris; set samples.giris; do i=1 to _n_; if sepallen > 70 then datacolor="CX33FFFF"; else datacolor="CXFF3333"; output; end; run; proc g3d data=work.giris; scatter petallen*petalwid=sepallen / zmin=50 zmax=60; run;
298 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
10.5.1 Summary The following tables show which parameters can be used with specific types of charts. Chart Type PLOT SCATTER
GRID
NONEEDLE
ROTATE
SHAPE
3
3
Chart Type PLOT SCATTER
TILT
XTICKNUM
YTICKNUM
ZTICKNUM
ZMAX/ZMIN
3
3 3
3 3
3 3
3
3
SIDE
SIZE
3 3
3
10.5.2 Non-supported parameters Some parameters are not supported by the Java device driver. XYTYPE
The XYTYPE parameter defines which directional lines to use to represent the surface of a surface plot.
P a r t
3
Putting It Together Chapter 11 Final Reports 301 Appendix A SAS/GRAPH Samples and WORK Data Sets 313
300 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
C h a p t e r
11
Final Reports 11.1 Report 1: Using SAS AppDev Studio 3 Tags 301 11.2 Report 2: Using ODS 307 11.3 Conclusions 310
In this chapter, we show complete examples of both SAS AppDev Studio tags and ODS statements. We show the output and the complete code, and then break down the code to highlight specific areas.
11.1 Report 1: Using SAS AppDev Studio 3 Tags The objective of this example is to produce a report on energy production for the years 1985 through 1988. We also want to use a graph style to quickly enhance the look of the report and give it a standard color theme. There are also some items we need to enhance to ensure that the information is easily read.
302 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
Here is the completed report, followed by the code that produced it.
Chapter 11: Final Reports 303
<sas:JDBCConnection id="jdbcConn" databaseURL="jdbc:sasiom://localhost:8591" connectionInfo="jdbcProperties" driverName="com.sas.rio.MVADriver" scope="session" /> <jsp:useBean id="jdbcTableModelAdaptor" scope="session" > <jsp:setProperty name="jdbcTableModelAdaptor" property="queryStatement" value="select * from samples.eprdcon2 where cptype='p'"/> <jsp:setProperty name="jdbcTableModelAdaptor" property="connection" value="" /> <jsp:useBean id="report1_TableDataModel" scope="session" > <jsp:setProperty name="report1_TableDataModel" property="model" value="" /> Energy Production 1985- 1988
<sas:PieChart id="report1Pie" model="report1_TableDataModel" scope="session" appliedGraphStyleName="gears" height="500" width="500"> <sas:PieChartModel responseLabelVisiblePolicy="false"> <sas:SubgroupLabelModel> <sas:ValueTextStyle justification="right"> 304 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System <sas:Font bold="true"/> <sas:LabelTextStyle color="black"> <sas:Font bold="true" /> <sas:LegendModel label="Energy Type"> <sas:ValueTextStyle> <sas:Font bold="true"/> <sas:LabelTextStyle color="black"> <sas:Font bold="true" /> |
For a review, let’s break down the JSP file. <sas:JDBCConnection id="jdbcConn" databaseURL="jdbc:sasiom://localhost:8591" connectionInfo="jdbcProperties" driverName="com.sas.rio.MVADriver" scope="session" />
This first section of the JSP file is merely the setup for the information needed later. First we need to make sure that the application knows where to find the tag library we need to produce the graph. Then we need to set some properties for the JDBC Connection object we create. Finally, we construct a JDBC Connection object and define its parameters. As a suggestion, you could place the connection information in a separate JSP file and use the <jsp:include..> tag to pull it into this JSP file. This will start you on the path of reuse and make the content of your JSP file more readable.
Chapter 11: Final Reports 305
<jsp:useBean id="jdbcTableModelAdaptor" scope="session" > <jsp:setProperty name="jdbcTableModelAdaptor" property="queryStatement" value="select * from samples.eprdcon2 where cptype='p'"/> <jsp:setProperty name="jdbcTableModelAdaptor" property="connection" value="" />
Now that we have a JDBC Connection object to use, we can set up our data by using the JDBCToTableModelAdapter. This adapter also needs to define only a portion of the data to use. In this case, we want only energy production values. We do not want to include any data that pertains to consumption. In the SQL statement, we add a WHERE clause to subset the data. <jsp:useBean id="report1_TableDataModel" scope="session" > <jsp:setProperty name="report1_TableDataModel" property="model" value="" />
It’s time now to construct the data model. Here we use the PieChartTableDataModel. The graph needs to set a category variable, which is used to collect the values into their respective energy types. Then we need a response variable, which contains the variable values used for the statistics. To help us define the differences between the categories year by year, we use a subgroup variable.
306 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
Energy Production 1985- 1988
<sas:PieChart id="report1Pie" model="report1_TableDataModel" scope="session" appliedGraphStyleName="gears" height="500" width="500"> <sas:PieChartModel responseLabelVisiblePolicy="false"> <sas:SubgroupLabelModel> <sas:ValueTextStyle justification="right"> <sas:Font bold="true"/> <sas:LabelTextStyle color="black"> <sas:Font bold="true" /> <sas:LegendModel label="Energy Type"> <sas:ValueTextStyle> <sas:Font bold="true"/> <sas:LabelTextStyle color="black"> <sas:Font bold="true" /> |
Here comes the fun stuff. Let’s take a look at the actual HTML. There are minimal HTML tags. There is a title we have used for output, as well as code for setting the graph in a table so we can easily center it on the page. The pie chart is created using the sas:PieChart tag. As stated before, we want to provide a quick and easy graph style for consistency. We have chosen the Gears style. Also, instead of using the Response Label as the title, we have elected to not show it and use the HTML tags instead at the top of the page. We find, however, that there are fonts and styles we want to override from Gears. For instance, the values in the subgroup do not show up as well as we had hoped. So we make those bold. We also make adjustments to the legend label.
Chapter 11: Final Reports 307
11.2 Report 2: Using ODS Even though we use the same requirements as for the SAS AppDev Studio example, we do not get the same results. The graphs are similar but utilize different methods in ODS.
308 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
<sasads:Connection id="bbuConnection" scope="session" /> <sasads:Submit id="smbStreamingBar" display="none" connection="bbuConnection"> libname samples ''; filename sock SOCKET ':'; goptions reset=all device=java xpixels=600 ypixels=400; ods listing close; ODS HTML body=sock rs=none CODEBASE="" parameters=("colorscheme"="fall") style=beige; legend1 label=('Energy Type'); title1 'Energy Production 1985 - 1988'; proc gchart data=samples.eprdcon2; pie engytype / sumvar=amount detail=year legend=legend1 ; run; ods html close;
Chapter 11: Final Reports 309
Now let’s review the code.
As in previous chapters, we need to enable the browser to use the SAS AppDev Studio 2 tags, and we need to make available all Java classes we will need. <sasads:Connection id="bbuConnection" scope="session" />
The connection object is fairly easy to create, because we are running the SAS/CONNECT Spawner.
If you remember from earlier, we also need to set up a socket and a few other Java variables to be used in streaming the SAS ODS statement back out to the browser. <sasads:Submit id="smbStreamingBar" display="none" connection="bbuConnection"> libname samples ''; filename sock SOCKET ':'; goptions reset=all device=java xpixels=600 ypixels=400; ods listing close; ODS HTML body=sock rs=none CODEBASE="" parameters=("colorscheme"="fall") style=beige; legend1 label=('Energy Type'); title1 'Energy Production 1985 - 1988';
310 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
proc gchart data=samples.eprdcon2; pie engytype / sumvar=amount subgroup=year legend=legend1 ; run; ods html close;
Then anything in the SubmitInterface block, as shown here, is written in SAS. So here we establish our library and filename. Then we need to set the options on the GOPTIONS statement to use the Java device driver. Then come the ODS statements. We modify the pie chart in several ways. We enable the chart to use the COLORSCHEME of FALL and a STYLE of BEIGE. The main difference that you can see is that the COLORSCHEME parameter affects the data elements (pie slices), whereas the STYLE parameter affects the text and labels. Then we create a legend and a title to use with the pie chart. Although the subgroup option in the PROC statement is not honored, it does, however, enable the legend to display.
Now it’s time to close everything up and make sure the socket can be available for someone else to use later.
11.3 Conclusions You may have wondered by now whether you should use SAS AppDev Studio tags or SAS ODS statements. You might want to start that debate by asking yourself who’s going to be doing most of the graphing and what their skills are. If it is you and you are uncomfortable with Java, you might want to just stick with SAS ODS. You can find tons of examples on SAS ODS, and we have given you just one way to stream back graphs. However, if you’re more of a Java developer, then you might prefer the SAS AppDev Studio tags, as they might be more familiar to you.
Chapter 11: Final Reports 311
When we first started thinking of writing this book, we were hesitant in writing much about the SAS AppDev Studio 2 tags. We knew their limitations and knew in the SAS 8.2 environment that it was just plain easier to get some of this graphing done using good old ® ODS. However, SAS 9 has come a long way. SAS AppDev Studio 3 tags are more robust than their version 2 counterparts, and once you get past the initial shock of all the nesting, they are quite easy to use. That is not to say, however, that they don’t have their limits. So all things being equal, choose which technique you want to use by knowing your own skills and the requirements of the reports that contain the graphs. Most important, have fun. We did.
312 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
A p p e n d i x
A
SAS/GRAPH Samples and WORK Data Sets Samples samples.grains # Variable 4 AMOUNT 1 COUNTRY 2 TYPE 3 YEAR
Type Num Char Char Num
Len 8 16 5 8
samples.clay # Variable 3 PCT_CLAY 1 X 2 Y
Type Num Num Num
Len 8 8 8
samples.rgnsites # Variable 2 REGION 3 SITES 4 STATE 1 STCODE
Type Num Num Num Char
Len 8 8 8 2
314 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
samples.energy1 # Variable 2 CONSUMED 1 YEAR
Type Num Num
Len 8 8
samples.giris # Variable 3 PETALLEN 4 PETALWID 1 SEPALLEN 2 SEPALWID 5 SPEC_NO
Type Num Num Num Num Num
Len 8 8 8 8 8
samples.hat # Variable 1 X 2 Y 3 Z
Type Num Num Num
Len 8 8 8
WORK work.clay data work.clay; set samples.clay; where x ge -10 and x le -4 and y ge -10 and y le 2; run; work.energyPrice proc sql; create table work.energyPrice as select year as year, consumed as energy, consumed*.03 as dollars, consumed*.03*125 as yen from samples.energy1; quit; # 1 3 2 4
Variable YEAR DOLLARS ENERGY YEN
Type Num Num Num Num
Len 8 8 8 8
References
Miron, Thomas. 1995. The How-To Book for SAS/GRAPH Software. Cary, NC: SAS Institute Inc. SAS Institute Inc. “Sampling of SAS Graph Styles.” http://support.sas.com/rnd/gendoc/bi/api/Components/com/sas/graphics/components/ doc-files/style-Grid.html. SAS Institute Inc. “SAS OnlineDoc 9.1.3.” http://support.sas.com/onlinedoc/913/docMainpage.jsp. SAS Institute Inc. “Technical Support.” http://support.sas.com/techsup/intro.html.
316 SAS Graphics for Java: Examples Using SAS AppDev Studio and the Output Delivery System
Index A across attribute 75 ACROSS parameter, GCHART procedure 242, 249, 264 alignment attribute 25 alt attribute (HTML image tag) 26 alternateText attribute 26 AMBIENT parameter, ODS statement 170–171, 173 ANGLE parameter, GCHART procedure 243, 264 antialiasedGraphics attribute BarChartModel tag (sas) 40 BarLineChartModel tag (sas) 50 LineChartModel tag (sas) 64 LinePlotModel tag (sas) 68 PieChartModel tag (sas) 75–76 RadarChartModel tag (sas) 88 ScatterPlotModel tag (sas) 92 antialiasedText attribute BarChartModel tag (sas) 41 BarLineChartModel tag 50–51 LineChartModel tag (sas) 64 LinePlotModel tag (sas) 68 PieChartModel tag (sas) 76 RadarChartModel tag (sas) 88 ScatterPlotModel tag (sas) 92 appliedColorSchemeName attribute 27, 44, 55 appliedGraphStyleName attribute 28 AREA parameter, GMAP procedure 273, 277 AREAS parameter, GPLOT procedure 278, 289 ASCENDING parameter, GCHART procedure 243, 264 attributes See also specific attributes Combination tag (sasads) 16
common 25–37 required for tags 14 AUTOHREF parameter GCONTOUR procedure 272 GPLOT procedure 279, 289 AUTOLABEL parameter, GCONTOUR procedure 227 AUTOREF parameter GCHART procedure 187, 244, 254, 264 GCONTOUR procedure 193 AUTOVREF parameter GCONTOUR procedure 272 GPLOT procedure 279, 289 axes See also X axis See also Y axis AXIS parameter 244, 260, 264 FRAME parameter 251 NOAXES parameter 230, 237, 239–240, 257, 266 NOAXIS parameter 230–231, 237–240 plots and 163 RAXIS parameter 244, 260 ReferenceLineModel tag (sas) 140 uniformAxes attribute 91 axis model tags categories attribute 100 ColumnAxisModel tag (sas) 110–111 continuousMajorTickAnchor attribute 101 continuousMajorTickCount attribute 101 continuousMajorTickInterval attribute 102 continuousMajorTickPositionPolicy attribute 102 continuousMajorTickValues attribute 103 continuousMinorTickCount attribute 103 corresponding graph models 109–111 endOffset attribute 104 gridInFront attribute 104–105 label attribute 105 majorTickTimeInterval attribute 105
318 Index
axis model tags (continued) nesting 100–111 reverseDirection attribute 106 RowAxisModel tag (sas) 110–111 startOffset attribute 106 AXIS parameter, GCHART procedure 244, 260, 264 AXIS statement 236–237, 252, 255 AxisLineStyle tag (sas) 130–132 AxisModel tag (sas) 100–111 AxisWallModel tag (sas) 118–119
B BACKCOLOR parameter, ODS statement 181 BACKDROPCOLOR parameter, ODS statement 171 BackgroundFillStyle tag (sas) 123 fill tag attributes 126–130 fillType attribute 119–120 gradientBlendBeginColor attribute 120 gradientBlendEndColor attribute 120 gradientFill attribute 121 gradientFillBeginColor attribute 120 gradientFillEndColor attribute 121 imageFill attribute 122 imageFillColor attribute 121 imageIcon attribute 122 nesting 119–123 solidBlendColor attribute 122 x attribute 122 y attribute 122 backgrounds BACKCOLOR parameter 181 fill tags 126–130 fillType attribute 119–120 TIPBACKCOLOR parameter 179 BACKIMAGE parameter, ODS statement 172, 174, 177 backslash, in tags 14 bar charts See also HBAR chart type See also stacked bar charts
See also VBAR chart type ASCENDING parameter 243 Bar tag (sasads) 15 BarChart tag (sas) 18 BarChartModel tag (sas) 40–50 BarLineChart tag (sas) 19, 50–63 changing shape of bars in 51 COLORSCHEME parameter 173 Combination tag (sasads) 16 FRONTREF parameter 251 GCHART procedure 154 gradients and 176 INSIDE parameter and 221 MISSING parameter 257 OUTSIDE parameter 224 Bar tag (sasads) 4–5, 15 BarChart tag (sas) BarChartModel tag (sas) and 40 example 4, 9 mimicking SegmentedBar graph 5 syntax 18 BarChartModel tag (sas) antialiasedGraphics attribute 40 antialiasedText attribute 41 AxisWallModel tag (sas) and 119 BackgroundFillStyle tag (sas) and 123 barShape attribute 41 barWidth attribute 42 barWidthSpace attribute 42 corresponding axis models 109, 111 corresponding legend models 113 corresponding line styles 116 corresponding text style tags 117–118 dimension attribute 43 insideBarLabelContent attribute 43–44 missingPolicy attribute 44 nesting 40 orientation attribute 45 outsideBarLabelContent attribute 46 response2AxisLowerThreshold attribute 46–47 response2AxisUpperThreshold attribute 47
Index 319
responseAxisLowerThreshold attribute 47–48 responseAxisUpperThreshold attribute 48 stackBarPolicy attribute 49–50 syntax 40 BarChartTableDataModel class 18 BarLineChart tag (sas) 5, 19, 50 BarLineChartModel tag (sas) antialiasedGraphics attribute 50 antialiasedText attribute 50–51 AxisWallModel tag (sas) and 119 BackgroundFillStyle tag (sas) and 123 barShape attribute 51 barWidth attribute 52 barWidthSpace attribute 53 corresponding axis models 109, 111 corresponding legend models 113 corresponding line styles 116 corresponding text style tags 117–118 dimension attribute 54 fillAreaEnabled attribute 54–55 insideBarLabelContent attribute 55 markerEnabled attribute 56 missingPolicy attribute 56–57 nesting 50 outsideBarLabelContent attribute 57 outsideMarkerLabelContent attribute 58 response2AxisLowerThreshold attribute 58–59 response2AxisUpperThreshold attribute 59 responseAxisLowerThreshold attribute 60 responseAxisUpperThreshold attribute 60–61 stackBarPolicy attribute 61–62 stackLinePolicy attribute 63 syntax 50 zeroHeightBarsVisible attribute 63 barResponse2Variable attribute 50, 62 barResponseVariable attribute 50, 62 barShape attribute 41, 51 barWidth attribute 42, 52
barWidthSpace attribute 42, 53 baselineAngle attribute 117, 136 BasicStroke tag (sas) 133 BCOLOR parameter, GPLOT procedure 200, 204 BFONT parameter, GPLOT procedure 234 BLABEL parameter, GPLOT procedure 235, 238 BLOCK chart type BLOCKSIZE parameter 274 GCHART procedure 192, 225–226, 264–267 GCONTOUR procedure 197 GMAP procedure 161, 199, 234, 277 SHAPE parameter 276 block maps 160–161 BLOCK statement, GMAP procedure 161 BLOCKMAX parameter, GCHART procedure 267 BLOCKSIZE parameter, GMAP procedure 274, 277 BODY option, ODS statement 150 BODY=SOCK option, ODS statement 150 bold attribute 133 borders 29, 180 borderWidth attribute 29 bottomMarkerLabelContent attribute 68–69, 92–93 BottomMarkerLabelTextStyle tag (sas) 116–117 BSCALE parameter, GPLOT procedure 280, 289 BSIZE parameter, GPLOT procedure 280, 289 bubble plots 164–165 BCOLOR parameter 200 BFONT parameter 234 BLABEL parameter 235 BSCALE parameter 280 BSIZE parameter 280 BUBBLE statement, GPLOT procedure example 164–165 supported parameters 204, 236–238, 289
320 Index
BUBBLE2 statement, GPLOT procedure example 164–165 supported parameters 204, 236–238, 289
C C parameter, GPLOT procedure 203 CA parameter, GPLOT procedure 200–201 case sensitivity 170 categories attribute 100 category variables 10 CategoryAxisModel tag (sas) 100–111, 133–134 categoryVariableName attribute 16–17 CAUTOHREF parameter GCONTOUR procedure 193 GPLOT procedure 200, 204 CAUTOREF parameter, GCHART procedure 187, 192 CAUTOVREF parameter, GPLOT procedure 201, 204 CAXIS parameter G3D procedure 204–205 GCHART procedure 187, 192 GCONTOUR procedure 193–194, 197 GPLOT procedure 200–201, 204 CBACK option, GOPTIONS statement 182 CBLKOUT parameter, GMAP procedure 198–199 CBOTTOM parameter, G3D procedure 205 CBY option, GOPTIONS statement 186 CEMPTY parameter, GMAP procedure 198 CERROR parameter, GCHART procedure 188, 192 CFILL parameter, GCHART procedure 188, 192 CFR parameter GCHART procedure 189, 192 GCONTOUR procedure 194 GPLOT procedure 202 CFRAME parameter GCHART procedure 189, 192 GCONTOUR procedure 194, 197 GPLOT procedure 202, 204
CFREG parameter, GCHART procedure 218, 225 CFREGLABEL parameter, GCHART procedure 226 CH parameter GCONTOUR procedure 195 GPLOT procedure 202 chart statistic 10 chart variables 10 CHORO chart type, GMAP procedure 199, 234, 277 choropleth maps 161, 199 CHREF parameter GCONTOUR procedure 195 GPLOT procedure 202, 204 classes, Java 148 CLEVELS parameter, GCONTOUR procedure 195, 197 CLIPREF parameter, GCHART procedure 245, 265 CLM parameter, GCHART procedure 245, 250, 265 CLOCKWISE parameter, GCHART procedure 246, 265 CODEBASE option, ODS statement 150 color attribute line style tags 114–115 line tags 131 MarkerStyle tag (sas) 138 ShadowStyle tag (sas) 136 text style tags 117 text tags 135 color parameters CTEXT parameter 219, 227, 232, 235 G3D procedure 204–205 GCHART procedure 186–193 GCONTOUR procedure 193–197 GMAP procedure 197–199 GOPTIONS statement 182–186 GPLOT procedure 199–204 MATCHCOLOR parameter 222 ODS statement 170–181
Index 321
ColorLegendModel tag (sas) 111–113 colors See also color attribute appliedColorSchemeName attribute 27, 44, 55 applying predefined 27 choropleth maps 161 color attribute 114–115, 117 ColorLegendModel tag (sas) 111 fill tags 126–130 gradientBlendBeginColor attribute 120, 127 gradientBlendEndColor attribute 120, 127 gradientFillBeginColor attribute 120, 128 gradientFillEndColor attribute 121, 128 imageFillColor attribute 121, 129 matchErrorColor attribute 71, 95 matchMarkerLabelColor attribute 71 matchNeedleColor attribute 72 otherColor attribute 82 solidBlendColor attribute 122, 129 COLORS= option, GOPTIONS statement 173, 183 COLORSCHEME parameter, ODS statement 173 ColumnAxisModel tag (sas) 110–111 Combination tag (sasads) categoryVariableName attribute 16 example 5 line charts 6 LinePlot tag (sas) and 7 responseVariableName attribute 16 subGroupVariableName attribute 16 syntax 16 Component Palette 4 confidence intervals 245 Connection tag (sasads) 148 connectionOrder attribute 138 contiguous variables 10, 21 continuousMajorTickAnchor attribute 101 continuousMajorTickCount attribute 101 continuousMajorTickInterval attribute 102
continuousMajorTickPositionPolicy attribute 102 continuousMajorTickValues attribute 103 continuousMinorTickCount attribute 103 Contour applet AMBIENT parameter 170 LEGENDFIT parameter 208 LEGENDFONT parameter 209 LEGENDFONTSIZE parameter 210 LIGHTING parameter 177 MINLEGENDFONTSIZE parameter 211 SHOWBACKDROP parameter 178 SHOWLEGEND parameter 211 contour plots 159–160 COUTLINE parameter GCHART procedure 189, 192 GCONTOUR procedure 196 GMAP procedure 198–199 GPLOT procedure 202 CPATTERN option, GOPTIONS statement 186 CPCT parameter, GCHART procedure 218 CPERCENT parameter, GCHART procedure 218, 225 CPERCENTLABEL parameter, GCHART procedure 226 CR parameter, GCHART procedure 190 CREF parameter, GCHART procedure 190, 192 CSYMBOL option, GOPTIONS statement 186 CTEXT option, GOPTIONS statement 184, 227, 232 CTEXT parameter G3D procedure 205, 239–240 GCHART procedure 190–192, 219, 225 GCONTOUR procedure 196–197, 227, 231 GMAP procedure 199, 232, 234 GPLOT procedure 203–204, 235, 238 MATCHCOLOR parameter and 222 CTITLE option, GOPTIONS statement 184 CTOP parameter, G3D procedure 205
322 Index
custom tags SAS AppDev Studio 2 15–17 SAS AppDev Studio 3 18–24 CV parameter GCONTOUR procedure 196 GPLOT procedure 203 CVREF parameter GCONTOUR procedure 196 GPLOT procedure 203–204
D dashPhase attribute 133 DashSegment tag (sas) 133 dashSegmentsChanged attribute 133 data extraction 148–150 data models 8, 18 DATA= option 151 data sets 10–11 DataElementStyle tag (sas) 115, 123, 137 dataSet attribute 9 DataSet tag (sasads) 9, 18 DataSetInterface 18 DataTipModel tag (sas) 123 depth variable See Z axis DESCENDING parameter, GCHART procedure 246, 265 DETAIL parameter DETAIL_PERCENT parameter and 219 DETAIL_VALUE parameter and 220 GCHART procedure 247, 265 DETAIL_PERCENT parameter, GCHART procedure 219, 225 DETAIL_RADIUS parameter, GCHART procedure 247, 265 DETAIL_SLICE parameter, GCHART procedure 220, 225 DETAIL_THRESHOLD parameter, GCHART procedure 248, 265 DETAIL_VALUE parameter, GCHART procedure 220, 226 DEVICE=JAVA option, GOPTIONS statement 150
dimension attribute 43, 54, 76 DIRECT parameter, ODS statement 170–171, 173 DISCRETE parameter GCHART procedure 248, 265 GMAP procedure 274, 277 discrete variables defined 11 DISCRETE parameter 248, 274 LineChart tag (sas) 20 LinePlot tag (sas) 21 DiscreteFillColor tag (sas) 137 displayedColumn attribute 9 DONUT chart type 158 CLOCKWISE parameter 246 DonutHoleLabelTextStyle tag (sas) 116–117 DONUTPCT parameter 249 GCHART parameter support 192 GCHART procedure 157, 192, 225–226, 264–267 PieChart tag (sas) 6, 22 PieChartModel tag (sas) 74–87 donutHoleLabel attribute 77 DonutHoleLabelTextStyle tag (sas) 116–118 donutHoleSize attribute 77–78 DONUTPCT parameter, GCHART procedure 249, 265 down attribute 78 DOWN parameter, GCHART procedure 249, 265 DRAWIMAGE parameter, ODS statement 172, 174–176
E endCap attribute 133 endOffset attribute 104 epilog attribute 30–31 ERRORBAR parameter, GCHART procedure 250, 265 EXPLODE parameter, GCHART procedure 250 explodedCategories attribute 79
Index 323
F family attribute 134 FBY option, GOPTIONS statement 217 FILENAME statement 149–150 fill area See also fillType attribute AREAS parameter 278 COUTLINE parameter 202 fillAreaEnabled attribute 54–55, 65, 69–70, 93 filledRadar attribute 88–89 PATTERN parameter 270 FILL parameter, GCHART procedure 188, 190–191 fill tags fillType attribute 127 gradientBlendBeginColor attribute 127 gradientBlendEndColor attribute 127 gradientFill attribute 128–129 gradientFillBeginColor attribute 128 gradientFillEndColor attribute 128 imageFillColor attribute 129 imageIcon attribute 129 solidBlendColor attribute 129 types 126 x attribute 129 y attribute 129 fillAreaEnabled attribute BarLineChartModel tag (sas) 54–55 LineChartModel tag (sas) 65 LinePlotModel tag (sas) 69–70 ScatterPlotModel tag (sas) 93 filledRadar attribute 88–89 FillStyle tag (sas) 126–130 fillType attribute BackgroundFillStyle tag (sas) 119–120 fill tags 127 gradientBlendBeginColor attribute and 120, 127 gradientBlendEndColor attribute and 120, 127 gradientFill attribute and 128–129
gradientFillBeginColor attribute and 120, 128 gradientFillEndColor attribute and 121, 128 imageFill attribute and 122 imageFillColor attribute and 121, 129 imageIcon attribute and 122, 129 solidBlendColor attribute and 122, 129 FloorFillStyle attribute 118 FloorFillStyle tag (sas) 126–130 Font tag (sas) bold attribute 133 CategoryAxisModel tag (sas) and 133 family attribute 134 italic attribute 134 LabelTextStyle tag (sas) and 133 nesting 125–126, 133 size attribute 134 FONTRES option, GOPTIONS statement 217 fonts BFONT parameter 234 FTEXT option 214 GOPTIONS statement support 214 LEGENDFONT parameter 209 LEGENDFONTSIZE parameter 210 MINLEGENDFONTSIZE parameter 211 FR parameter, GPLOT procedure 281 FRAME parameter GCHART procedure 251, 265 GPLOT procedure 281, 289 FrameLineStyle tag (sas) 113–115, 130–132 frames FRAME parameter 251, 265, 281, 289 FrameLineStyle tag (sas) 113–115, 130–132 FREQ parameter, GCHART procedure 221, 226, 265 FREQLABEL parameter, GCHART procedure 226 FREQNAME parameter, ODS statement 213 FRONTREF parameter, GCHART procedure 251, 266 FTEXT option, GOPTIONS statement 214 FTITLE option, GOPTIONS statement 215
324 Index
FTRACK option, GOPTIONS statement 217
G G3D procedure AMBIENT parameter and 170 BACKDROPCOLOR parameter and 171 CAXIS parameter 204–205 CBOTTOM parameter 205 color parameters 204–205 CTEXT parameter 205, 239–240 CTOP parameter 205 GRID parameter 290, 298 NOAXES parameter 239–240 NOAXIS parameter 239–240 NOLABEL parameter 240 non-supported parameters 205, 298 NONEEDLE parameter 291, 298 other parameters 290–298 PLOT statement 205, 240, 298 ROTATE parameter 291–292, 298 scatter plots 166 SHAPE parameter 292, 298 SIDE parameter 293, 298 SIZE parameter 293–294, 298 surface plots 167 text parameters 239–240 TILT parameter 294, 298 TIPBACKCOLOR parameter 179 TIPBORDERCOLOR parameter 180 TIPTEXTCOLOR parameter 180 XTICKNUM parameter 295, 298 XYTYPE parameter 298 YTICKNUM parameter 295–296, 298 ZMAX parameter 297–298 ZMIN parameter 297–298 ZTICKNUM parameter 296, 298 G100 parameter, GCHART procedure 252, 266 galleryImageVisible attribute 31 GAXIS parameter, GCHART procedure 252, 255, 266 GCHART procedure
See also GROUP parameter, GCHART procedure ACROSS parameter 242, 249, 264 ANGLE parameter 243, 264 ASCENDING parameter 243, 264 AUTOREF parameter 187, 244, 254, 264 AXIS parameter 244, 260, 264 BACKDROPCOLOR parameter and 171 BACKIMAGE parameter 172 bar chart support 154 BLOCKMAX parameter 267 CAUTOREF parameter 187, 192 CAXIS parameter 187, 192 CERROR parameter 188, 192 CFILL parameter 188, 192 CFR parameter 189, 192 CFRAME parameter 189, 192 CFREG parameter 218, 225 CFREGLABEL parameter 226 CLIPREF parameter 245, 265 CLM parameter 245, 250, 265 CLOCKWISE parameter 246, 265 color parameters 186–193 connection example 150 COUTLINE parameter 189, 192 CPCT parameter 218 CPERCENT parameter 218, 225 CPERCENTLABEL parameter 226 CR parameter 190 CREF parameter 190, 192 CTEXT parameter 190–192, 219, 225 DESCENDING parameter 246, 265 DETAIL parameter 247, 265 DETAIL_PERCENT parameter 219, 225 DETAIL_RADIUS parameter 247, 265 DETAIL_SLICE parameter 220, 225 DETAIL_THRESHOLD parameter 248, 265 DETAIL_VALUE parameter 220, 226 DISCRETE parameter 248, 265 donut charts 157, 192, 225–226, 264–267 DONUTPCT parameter 249, 265 DOWN parameter 249, 265
Index 325
ERRORBAR parameter 250, 265 EXPLODE parameter 250 FILL parameter 188, 190–191 FRAME parameter 251, 265 FREQ parameter 221, 226, 265 FREQLABEL parameter 226 FRONTREF parameter 251, 266 G100 parameter 252, 266 GAXIS parameter 252, 255, 266 GROUP parameter 242–243, 246–247, 249, 252–253, 266 GSPACE parameter 253, 266 IFRAME parameter 193 IMAGESTYLE parameter 193 INSIDE parameter 221, 226 INVISIBLE parameter 191–192, 222, 226 LAUTOREF parameter 254, 266 LEGEND parameter 254, 266 LEVELS parameter 255, 266 LREF parameter 267 MATCHCOLOR parameter 191–192, 222, 226 MAXIS parameter 255, 266 MEAN parameter 223, 226 MEANLABEL parameter 226 MIDPOINTS parameter 248, 256, 266 MIDPOINTS=OLD parameter 256 MISSING parameter 257, 266 NOAXES parameter 257, 266 NOBASEREF parameter 267 NOFR parameter 251 NOFRAME parameter 251 NOGROUPHEADING parameter 258, 266 NOHEADING parameter 258 NOLEGEND parameter 258, 266 non-supported parameters 193, 226, 267 NOSTATS parameter 267 NOZERO parameter 267 OTHER parameter 259, 267 other parameters 242–267 OTHERCOLOR parameter 192 OTHERLABEL parameter 223, 226
OUTSIDE parameter 224, 226 PATTERNID parameter 259, 267 PERCENT parameter 224, 226 PERCENTLABEL parameter 226 pie charts 157, 192, 225–226, 264–267 RANGE parameter 225–226 RAXIS parameter 244, 260 REF parameter 260, 267 SHAPE parameter 261, 267 SLICE parameter 261, 267 SPACE parameter 262, 267 SUBGROUP parameter 247, 250, 258, 262–263, 267 SUMVAR parameter 155, 157, 263, 267 text parameters 217–226 TYPE parameter 263, 267 WIDTH parameter 264, 267 WOUTLINE parameter 267 GCONTOUR procedure AMBIENT parameter and 170 AUTOHREF parameter 272 AUTOLABEL parameter 227 AUTOREF parameter 193 AUTOVREF parameter 272 BACKDROPCOLOR parameter and 171 CAUTOHREF parameter 193 CAXIS parameter 193–194, 197 CFR parameter 194 CFRAME parameter 194, 197 CH parameter 195 CHREF parameter 195 CLEVELS parameter 195, 197 color parameters 193–197 contour plots 159 COUTLINE parameter 196 CTEXT parameter 196–197, 227, 231 CV parameter 196 CVREF parameter 196 GRID parameter 272 HAXIS parameter 228, 231 HMINOR parameter 268 HREF parameter 272 HREVERSE parameter 228
326 Index
GCONTOUR procedure (continued) IBACK option, GOPTIONS statement 185 JOIN parameter 269 LAUTOHREF parameter 272 LAUTOVREF parameter 272 LEGEND parameter 229, 231 LEVELS parameter 229, 231 LHREF parameter 273 LLEVELS parameter 273 LVREF parameter 273 NLEVELS parameter 269 NOAXES parameter 230 NOAXIS parameter 230–231 NOFR parameter 270 NOFRAME parameter 270 NOLEGEND parameter 230–231 non-supported parameters 272–273 other parameters 268–273 PATTERN parameter 270 PLOT statement 159, 231 text parameters 227–231 TIPBACKCOLOR parameter 179 TIPBORDERCOLOR parameter 180 TIPTEXTCOLOR parameter 180 VAXIS parameter 231 VM parameter 271 VMINOR parameter 271 VREF parameter 273 VREVERSE parameter 231 XTICKNUM parameter 271 YTICKNUM parameter 272 GMAP procedure AREA parameter 273, 277 BACKDROPCOLOR parameter and 171 block maps 160 BLOCK statement 161 BLOCKSIZE parameter 274, 277 CBLKOUT parameter 198–199 CEMPTY parameter 198 CHORO chart type 199, 234, 277 choropleth maps 161 color parameters 197–199
COUTLINE parameter 198–199 CTEXT parameter 199, 232, 234 DISCRETE parameter 274, 277 DRAWIMAGE parameter 174 ID statement 161, 273 LEGEND parameter 232–234 LEVELS parameter 233–234 MIDPOINTS parameter 275, 277 MISSING parameter 275–277 NOLEGEND parameter 233–234 non-supported parameters 278 other parameters 273–278 PRISM statement 162, 199, 234, 277 SHAPE parameter 276–277 text parameters 232–234 TIPBACKCOLOR parameter 179 TIPTEXTCOLOR parameter 180–181 WOUTLINE parameter 278 XLIGHT parameter 278 XSIZE parameter 278 XVIEW parameter 277 YLIGHT parameter 278 YSIZE parameter 278 YVIEW parameter 277 ZVIEW parameter 277 GOPTIONS statement CBACK option 182 CBY option 186 color options 182–186 COLORS= option 173, 183 CPATTERN option 186 CSYMBOL option 186 CTEXT option 184, 227, 232 CTITLE option 184 DEVICE=JAVA option 150 FBY option 217 FONTRES option 217 FTEXT option 214 FTITLE option 215 FTRACK option 217 HBY option 217 HTEXT option 216 HTITLE option 216–217
Index 327
IBACK option 185 IMAGEPRINT option 186 IMAGESTYLE option 185–186 NOIMAGEPRINT option 186 non-support options 186, 217 NOTRANSPARENCY option 186 OFFSHADOW option 186 RESET option 150 text options 214–217 TRANSPARENCY option 186 XPIXELS option 150, 208–209 YPIXELS option 150, 208–209 GPLOT procedure AREAS parameter 278, 289 AUTOHREF parameter 279, 289 AUTOVREF parameter 279, 289 BCOLOR parameter 200, 204 BFONT parameter 234 BLABEL parameter 235, 238 BSCALE parameter 280, 289 BSIZE parameter 280, 289 bubble plots 164–165 BUBBLE statement 164–165, 204, 236–238, 289 BUBBLE2 statement 164–165, 204, 236–238, 289 C parameter 203 CA parameter 200–201 CAUTOHREF parameter 200, 204 CAUTOVREF parameter 201, 204 CAXIS parameter 200–201, 204 CFR parameter 202 CFRAME parameter 202, 204 CH parameter 202 CHREF parameter 202, 204 color parameters 199–204 COUTLINE parameter 202 CTEXT parameter 203–204, 235, 238 CV parameter 203 CVREF parameter 203–204 FR parameter 281 FRAME parameter 281, 289 GRID parameter 281, 289
HAXIS parameter 236, 238 HM parameter 282 HMINOR parameter 282, 289 HREF parameter 282, 289 HREVERSE parameter 236–238 HZERO parameter 283, 289 IFRAME parameter 290 IMAGESTYLE parameter 290 LAUTOHREF parameter 283, 289 LAUTOVREF parameter 284, 289 LEGEND parameter 284, 289 LH parameter 285 LHREF parameter 285, 289 LV parameter 285 LVREF parameter 285, 289 NOAXES parameter 237 NOAXIS parameter 237–238 NOFR parameter 281 NOFRAME parameter 281 NOLEGEND parameter 286, 289 non-supported parameters 289–290 other parameters 278–290 OVERLAY parameter 286, 289 PLOT statement 165, 204, 236–238, 289 PLOT2 statement 165–166, 204, 236–238, 284, 289 REGEQN parameter 290 SKIPMISS parameter 286–287, 289 text parameters 234–238 VAXIS parameter 237–238 VM parameter 287 VMINOR parameter 287, 289 VREF parameter 288–289 VREVERSE parameter 238 VZERO parameter 288–289 GRADIENTBACKGROUND parameter, ODS statement 176–177 gradientBlendBeginColor attribute 120, 127 gradientBlendEndColor attribute 120, 127 GRADIENTENDCOLOR parameter, ODS statement 176–177 gradientFill attribute 121, 128–129 gradientFillBeginColor attribute 120, 128
328 Index
gradientFillEndColor attribute 121, 128 GRADIENTSTARTCOLOR parameter, ODS statement 176–177 Graph applet 173, 176, 214 graph model tags BackgroundFillStyle tag (sas) and 122 BarChartModel tag (sas) 40–50 BarLineChartModel tag (sas) 50–63 corresponding axis models 109–111 corresponding legend model tags 113 corresponding line styles 116 corresponding text style tags 117–118 LineChartModel tag (sas) 64–67 LinePlotModel tag (sas) 67–74 nesting 40 nesting axis model tags 100–111 nesting AxisWallModel tag (sas) 118–119 nesting BackgroundFillStyle tag (sas) 119–123 nesting DataElementStyle tag (sas) 123 nesting DataTipModel tag (sas) 123 nesting legend model tags 111–113 nesting line style tags 113–116 nesting SubgroupLabelModel tag (sas) 124 nesting text style tags 116–118 PieChartModel tag (sas) 74–87 RadarChartModel tag (sas) 87–91 ScatterPlotModel tag (sas) 92–97 supporting tags and 126 Graphics tab (Component Palette) 4 graphs adding to projects 8–9 adding white space to 33, 36 adjusting width of 36–37 creating 153–167 creating in JSP 3–8 data sets and 10–11 disabling displays of 35 predefined styles 28 resizing 31 setting height 32 GRID parameter
G3D procedure 290, 298 GCONTOUR procedure 272 GPLOT procedure 281, 289 gridInFront attribute 104–105 GridLineStyle tag (sas) 130–132 GROUP parameter, GCHART procedure 253 ACROSS parameter and 242 ASCENDING parameter and 243 corresponding chart types 266 DESCENDING parameter and 246 DETAIL parameter and 247 DOWN parameter and 249 G100 parameter and 252 NOGROUPHEADING parameter and 258 GSPACE parameter, GCHART procedure 253, 266
H HAXIS parameter GCONTOUR procedure 228, 231 GPLOT procedure 236, 238 HBAR chart type 154–155 GCHART procedure 192, 225–226, 264–267 orientation attribute 45 HBAR3D chart type, GCHART procedure 192, 225–226, 264–267 HBY option, GOPTIONS statement 217 height attribute 32 HM parameter, GPLOT procedure 282 HMINOR parameter GCONTOUR procedure 268 GPLOT procedure 282, 289 horizontal axis See X axis horizontal bar charts See HBAR chart type horizontalSpace attribute 33 hovering 26 HREF parameter GCONTOUR procedure 272 GPLOT procedure 282, 289 HREVERSE parameter
Index 329
GCONTOUR procedure 228 GPLOT procedure 236–238 HTEXT option, GOPTIONS statement 216 HTITLE option, GOPTIONS statement 216–217 HTML image tag alignment attribute 25 alt attribute and 26 borderWidth attribute 29 height attribute 32 horizontalSpace attribute 33 verticalSpace attribute 36 width attribute and 37 HZERO parameter, GPLOT procedure 283, 289
I IBACK option, GOPTIONS statement 185 icons 122, 129 id attribute 14 ID statement Connection tag (sasads) 148 GMAP procedure 161, 273 IFRAME parameter GCHART procedure 193 GPLOT procedure 290 image attribute 33 image tag (HTML) See HTML image tag imageFill attribute 122 imageFillColor attribute 121, 129 imageIcon attribute 122, 129 IMAGEPOSX parameter, ODS statement 174 IMAGEPOSY parameter, ODS statement 174 IMAGEPRINT option, GOPTIONS statement 186 IMAGESTYLE option, GOPTIONS statement 185–186 IMAGESTYLE parameter GCHART procedure 193 GPLOT procedure 290
importing Java classes 148 inFront attribute 107, 140 INSIDE parameter, GCHART procedure 221, 226 insideBarLabelContent attribute 43–44, 55 InsideBarLabelTextStyle tag (sas) 116–118 insideSliceLabelContent attribute 79–80 insideSliceLabelPlacement attribute 80 InsideSliceLabelTextStyle tag (sas) 116–118 INTERPOL option, SYMBOL statement 278 interpolation attribute 139 interpolationEnabled attribute 70, 93–94 INVISIBLE parameter, GCHART procedure 191–192, 222, 226 invisibleCategories attribute 81 isRendered parameter 35 italic attribute 134
J JAR files 150 Java classes 148 Java Database Connectivity (JDBC) 8 Java language 146, 148 Java variables 149–150 JavaServer Page See JSP (JavaServer Page) JDBC (Java Database Connectivity) 8 JOIN parameter, GCONTOUR procedure 269 JSP (JavaServer Page) creating graphs in 3–8 general requirements 148 general structure 146–147 SAS support 146 justification attribute 117, 135
L label attribute 105, 111, 140–141 labelInsideCategory attribute 87 labelInsidePercent attribute 87 labelInsideResponse attribute 87 labelOutsideCategory attribute 87 labelOutsidePercent attribute 87 labelOutsideResponse attribute 87
330 Index
labelPlacement attribute 112, 141 labels appliedColorSchemeName attribute 44, 55 AUTOLABEL parameter 227 BLABEL parameter 235 bottomMarkerLabelContent attribute 68–69, 92–93 BottomMarkerLabelTextStyle tag (sas) 116–117 CTEXT parameter 219, 235 DETAIL_SLICE parameter 220 donutHoleLabel attribute 77 DonutHoleLabelTextStyle tag (sas) 116–117 insideBarLabelContent attribute 43–44, 55 InsideBarLabelTextStyle tag (sas) 116–117 insideSliceLabelContent attribute 79–80 insideSliceLabelPlacement attribute 80 InsideSliceLabelTextStyle tag (sas) 116–117 INVISIBLE parameter 222 label attribute 105, 111, 140–141 labelInsideCategory attribute 87 labelInsidePercent attribute 87 labelInsideResponse attribute 87 labelOutsideCategory attribute 87 labelOutsidePercent attribute 87 labelOutsideResponse attribute 87 labelPlacement attribute 112, 141 MATCHCOLOR parameter 191, 222 NOAXES parameter 257 NOLABEL parameter 240 otherSliceLabel attribute 82 outsideBarLabelContent attribute 46, 57 OutsideBarLabelTextStyle tag (sas) 116–117 outsideMarkerLabelContent attribute 58, 66–67 OutsideMarkerLabelTextStyle tag (sas) 116–117 outsideSliceLabelContent attribute 83–84
OutsideSliceLabelTextStyle tag (sas) 116–117 outsideSlicePlacement attribute 84 responseLabelVisiblePolicy attribute 85 SubgroupLabelModel tag (sas) 124 topMarkerLabelContent attribute 73–74, 96–97 TopMarkerLabelTextStyle tag (sas) 116–117 width attribute 37 LabelTextStyle tag (sas) 133–135 LAUTOHREF parameter GCONTOUR procedure 272 GPLOT procedure 283, 289 LAUTOREF parameter, GCHART procedure 254, 266 LAUTOVREF parameter GCONTOUR procedure 272 GPLOT procedure 284, 289 legend model tags 111–113 LEGEND parameter GCHART procedure 254, 266 GCONTOUR procedure 229, 231 GMAP procedure 232–234 GPLOT procedure 284, 289 LEGEND statement 229 LEGENDFIT parameter, ODS statement 208–209 LEGENDFONT parameter, ODS statement 209 LEGENDFONTSIZE parameter, ODS statement 210 LegendModel tag (sas) 111–113 length attribute 133, 137 LEVELS parameter DISCRETE parameter and 248 GCHART procedure 255, 266 GCONTOUR procedure 229, 231 GMAP procedure 233–234 LEGENDFONTSIZE parameter and 210 LH parameter, GPLOT procedure 285 LHREF parameter GCONTOUR procedure 273
Index 331
GPLOT procedure 285, 289 LIBNAME statement 149–150 LIGHTING parameter, ODS statement 177–178 line charts BarLineChart tag (sas) 19, 50–63 LineChart tag (sas) 20 LineChartModel tag (sas) 64–67 SAS AppDev Studio 2 support 16 line/line style tags 113–116, 130–133 line plots 21, 67–74 LineChart tag (sas) 5–6, 20, 64 LineChartModel tag (sas) antialiasedGraphics attribute 64 antialiasedText attribute 64 AxisWallModel tag (sas) and 119 BackgroundFillStyle tag (sas) and 123 corresponding axis models 109, 111 corresponding legend models 113 corresponding line styles 116 corresponding text style tags 117–118 fillAreaEnabled attribute 65 markerEnabled attribute 65 missingPolicy attribute 66 nesting 64 outsideMarkerLabelContent attribute 66–67 response axis thresholds 67 stackLinePolicy attribute 67 syntax 64 lineJoin attribute 133 LineLegendModel tag (sas) 111–112 LinePlot tag (sas) 7, 21, 67 LinePlotModel tag (sas) antialiasedGraphics attribute 68 antialiasedText attribute 68 AxisWallModel tag (sas) and 119 BackgroundFillStyle tag (sas) and 123 bottomMarkerLabelContent attribute 68–69 corresponding axis models 110–111 corresponding legend models 113 corresponding line styles 116
corresponding text style tags 117–118 fillAreaEnabled attribute 69–70 interpolationEnabled attribute 70 markerEnabled attribute 70 matchErrorColor attribute 71 matchMarkerLabelColor attribute 71 matchNeedleColor attribute 72 nesting 67 skipMissing attribute 72–73 syntax 67 topMarkerLabelContent attribute 73–74 xAxisBaseline attribute 74 y2AxisBaseline attribute 74 yAxisBaseline attribute 74 lineWidth attribute 133 LLEVELS parameter, GCONTOUR procedure 273 LREF parameter, GCHART procedure 267 LV parameter, GPLOT procedure 285 LVREF parameter GCONTOUR procedure 273 GPLOT procedure 285, 289
M MajorTickStyle tag (sas) 136–137 majorTickTimeInterval attribute 105 maps AREA parameter 273 block 160–161 choropleth 161, 199 prism 162, 199 surface 163 markerEnabled attribute BarLineChartModel tag (sas) 56 LineChartModel tag (sas) 65 LinePlotModel tag (sas) 70 ScatterPlotModel tag (sas) 94 markers bottomMarkerLabelContent attribute 68–69, 92–93 BottomMarkerLabelTextStyle tag (sas) 116–117 interpolationEnabled attribute 70, 93–94
332 Index
markerEnabled attribute 56, 65, 70, 94 MarkerStyle tag (sas) 137–140 matchErrorColor attribute 71 matchMarkerLabelColor attribute 71 maxMarkerSize attribute 95 minMarkerSize attribute 95 outsideMarkerLabelContent attribute 58, 66–67 OutsideMarkerLabelTextStyle tag (sas) 116–117 topMarkerLabelContent attribute 73–74, 96–97 TopMarkerLabelTextStyle tag (sas) 116–117 MarkerStyle tag (sas) color attribute 138 connectionOrder attribute 138 DataElementStyle tag (sas) and 137 interpolation attribute 139 nesting 137 size attribute 139 symbol attribute 139–140 syntax 138 MATCHCOLOR parameter, GCHART procedure 191–192, 222, 226 matchErrorColor attribute 71, 95 matchMarkerLabelColor attribute 71 matchNeedleColor attribute 72 MAXIS parameter, GCHART procedure 255, 266 maxMarkerSize attribute 95 MEAN parameter, GCHART procedure 223, 226 MEANLABEL parameter, GCHART procedure 226 midpoint axis 10 midpoints 10, 191, 256 MIDPOINTS parameter GCHART procedure 248, 256, 266 GMAP procedure 275, 277 MIDPOINTS=OLD parameter, GCHART procedure 256
MINLEGENDFONTSIZE parameter, ODS statement 211 minMarkerSize attribute 95 MinorTickStyle tag (sas) 136–137 MISSING parameter GCHART procedure 257, 266 GMAP procedure 275–277 missing values MISSING parameter 257, 275 missingPolicy attribute 44, 56–57, 66, 81–82, 89–90 SKIPMISS parameter 286–287 skipMissing attribute 72–73, 95 missingPolicy attribute BarChartModel tag (sas) 44 BarLineChartModel tag (sas) 56–57 LineChartModel tag (sas) 66 PieChartModel tag (sas) 81–82 RadarChartModel tag (sas) 89–90 miterLimit attribute 133 model attribute 14
N NeedleLineStyle tag (sas) 113–115 needles 72, 113–115, 291 nesting axis model tags 100–111 AxisWallModel tag (sas) 118–119 BackgroundFillStyle tag (sas) 119–123 BarChartModel tag (sas) 40 BarLineChartModel tag (sas) 50 ColumnAxisModel tag (sas) 110–111 DashSegment tag (sas) 133 DataElementStyle tag (sas) 123 DataTipModel tag (sas) 123 Font tag (sas) 125–126, 133 graph model tags 40, 99–124 LabelTextStyle tag (sas) 134 legend model tags 111–113 line style tags 113–116 LineChartModel tag (sas) 64 LinePlotModel tag (sas) 67 MarkerStyle tag (sas) 137
Index 333
PieChartModel tag (sas) 74 RadarChartModel tag (sas) 87 RowAxisModel tag (sas) 110–111 ScatterPlotModel tag (sas) 92 SubgroupLabelModel tag (sas) 124 tags 14 text style tags 116–118 ValueTextStyle tag (sas) 134 NLEVELS parameter, GCONTOUR procedure 269 NOAXES parameter G3D procedure 239–240 GCHART procedure 257, 266 GCONTOUR procedure 230 GPLOT procedure 237 NOAXIS parameter G3D procedure 239–240 GCONTOUR procedure 230–231 GPLOT procedure 237–238 NOBASEREF parameter, GCHART procedure 267 NOFR parameter GCHART procedure 251 GCONTOUR procedure 270 GPLOT procedure 281 NOFRAME parameter GCHART procedure 251 GCONTOUR procedure 270 GPLOT procedure 281 NOGROUPHEADING parameter, GCHART procedure 258, 266 NOHEADING parameter, GCHART procedure 258 NOIMAGEPRINT option, GOPTIONS statement 186 NOLABEL parameter, G3D procedure 240 NOLEGEND parameter GCHART procedure 258, 266 GCONTOUR procedure 230–231 GMAP procedure 233–234 GPLOT procedure 286, 289 NONEEDLE parameter, G3D procedure 291, 298
NOSTATS parameter, GCHART procedure 267 NOTRANSPARENCY option, GOPTIONS statement 186 NOZERO parameter, GCHART procedure 267
O ODS statement AMBIENT parameter 170–171, 173 BACKCOLOR parameter 181 BACKDROPCOLOR parameter 171 BACKIMAGE parameter 172, 174, 177 BODY option 150 BODY=SOCK option 150 CODEBASE option 150 color parameters 170–181 COLORSCHEME parameter 173 connection example 150 DIRECT parameter 170–171, 173 DRAWIMAGE parameter 172, 174–176 FREQNAME parameter 213 GRADIENTBACKGROUND parameter 176–177 GRADIENTENDCOLOR parameter 176–177 GRADIENTSTARTCOLOR parameter 176–177 IMAGEPOSX parameter 174 IMAGEPOSY parameter 174 LEGENDFIT parameter 208–209 LEGENDFONT parameter 209 LEGENDFONTSIZE parameter 210 LIGHTING parameter 177–178 MINLEGENDFONTSIZE parameter 211 non-supported parameters 213 OUTLINECOLOR parameter 181 PARAMETERS= option 170–181, 208–213 reports 307–310 RS option 150 RS=NONE option 150 SHOWBACKDROP parameter 178–179
334 Index
ODS statement (continued) SHOWLEGEND parameter 211 text parameters 208–213 TIPBACKCOLOR parameter 179 TIPBORDERCOLOR parameter 180 TIPMODE parameter 212 TIPS parameter 212 TIPTEXTCOLOR parameter 180–181, 213 ODS USEGOPT statement 215–217 offsets 104, 106, 136 offsetX attribute 136 offsetY attribute 136 OFFSHADOW option, GOPTIONS statement 186 orientation attribute 45 OTHER parameter, GCHART procedure 259, 267 otherColor attribute 82 OTHERCOLOR parameter, GCHART procedure 192 OTHERLABEL parameter, GCHART procedure 223, 226 otherSliceLabel attribute 82 otherThreshold attribute 83 OUTLINECOLOR parameter, ODS statement 181 OutlineLineStyle tag (sas) 130–132 OUTSIDE parameter, GCHART procedure 224, 226 outsideBarLabelContent attribute 46, 57 OutsideBarLabelTextStyle tag (sas) 116–118 outsideMarkerLabelContent attribute 58, 66–67 OutsideMarkerLabelTextStyle tag (sas) 116–118 outsideSliceLabelContent attribute 83–84 OutsideSliceLabelTextStyle tag (sas) 116–118 outsideSlicePlacement attribute 84 OVERLAY parameter, GPLOT procedure 286, 289
P padding See white space parameters G3D procedure 204–205, 239–240, 290–298 GCHART procedure 186–193, 217–226, 242–267 GCONTOUR procedure 193–197, 227–231, 268–273 GMAP procedure 197–199, 232–234, 273–278 GOPTIONS statement 182–186, 214–217 GPLOT procedure 199–204, 234–238, 278–290 ODS statement 170–181, 208–213 render attribute and 35 PARAMETERS= option, ODS statement 170–181, 208–213 PATTERN parameter, GCONTOUR procedure 270 PATTERN statement 259 PATTERNID parameter, GCHART procedure 259, 267 PERCENT parameter, GCHART procedure 224, 226 PERCENTLABEL parameter, GCHART procedure 226 PIE chart type 156–158 ANGLE parameter 243 CLOCKWISE parameter 246 DETAIL_RADIUS parameter 247 DETAIL_THRESHOLD parameter 248 donut charts and 156, 158 DOWN parameter 249 EXPLODE parameter 250 FILL parameter 190 GCHART procedure 157, 192, 225–226, 264–267 INVISIBLE parameter 222 MISSING parameter 257 NOGROUPHEADING parameter 258 OTHERLABEL parameter 223
Index 335
Pie tag (sasads) 16 PieChart tag (sas) 22 PieChartModel tag (sas) 74–87 ringed pie charts 6, 22 star charts and 159 SubgroupLabelModel tag (sas) 124 Pie tag (sasads) 6, 16 PIE3D chart type, GCHART procedure 192, 225–226, 264–267 PieChart tag (sas) 6, 22, 74 PieChartModel tag (sas) across attribute 75 antialiasedGraphics attribute 75–76 antialiasedText attribute 76 AxisWallModel tag (sas) and 119 BackgroundFillStyle tag (sas) and 123 corresponding axis models 111 corresponding legend models 113 corresponding line styles 116 corresponding text style tags 117–118 dimension attribute 76 donutHoleLabel attribute 77 donutHoleSize attribute 77–78 down attribute 78 explodedCategories attribute 79 insideSliceLabelContent attribute 79–80 insideSliceLabelPlacement attribute 80 invisibleCategories attribute 81 labelInsideCategory attribute 87 labelInsidePercent attribute 87 labelInsideResponse attribute 87 labelOutsideCategory attribute 87 labelOutsidePercent attribute 87 labelOutsideResponse attribute 87 missingPolicy attribute 81–82 nesting 74 otherColor attribute 82 otherSliceLabel attribute 82 otherThreshold attribute 83 outsideSliceLabelContent attribute 83–84 outsideSlicePlacement attribute 84 responseLabelVisiblePolicy attribute 85 reverseDirection attribute 86
sliceOrder attribute 86–87 startAngle attribute 87 syntax 74 placement attribute 112, 124, 137 plot charts 163, 165 PLOT statement G3D procedure 205, 240, 298 GCONTOUR procedure 159, 231 GPLOT procedure 165, 204, 236–238, 289 PLOT2 statement, GPLOT procedure example 165–166 supported parameters 204, 236–238, 284, 289 port numbers 148 position attribute 108, 141 PRISM chart type, GMAP procedure 162, 199, 234, 277 projects, adding graphs to 8–9 prolog attribute 34–35
R RadarChart tag (sas) 8, 23, 87 RadarChartModel tag (sas) antialiasedGraphics attribute 88 antialiasedText attribute 88 AxisWallModel tag (sas) and 119 BackgroundFillStyle tag (sas) and 123 corresponding axis models 108, 111 corresponding legend models 113 corresponding line styles 116 corresponding text style tags 117–118 filledRadar attribute 88–89 missingPolicy attribute 89–90 nesting 87 radarType attribute 90 startAngle attribute 91 syntax 88 uniformAxes attribute 91 radarType attribute 90 RANGE parameter, GCHART procedure 225–226 RAXIS parameter, GCHART procedure 244, 260
336 Index
REF parameter, GCHART procedure 260, 267 ReferenceLineModel tag (sas) 140–141 REGEQN parameter, GPLOT procedure 290 render attribute 35 reports ODS statement 307–310 SAS AppDev Studio 3 tags 301–306 RESET option, GOPTIONS statement 150 resizing graphs 31 response axis barResponseVariable attribute 50, 62 defined 10 ResponseAxisBaselineModel tag (sas) 107–108 responseAxisLowerThreshold attribute 47–48, 60, 67 ResponseAxisModel tag (sas) 100, 109 responseAxisUpperThreshold attribute 48, 60–61, 67 response variables 10, 275 response2 axis barResponse2Variable attribute 50, 62 Response2Axis Model tag (sas) 100, 109 Response2AxisBaselineModel tag (sas) 107–108 response2AxisLowerThreshold attribute 46–47, 58–59, 67 response2AxisUpperThreshold attribute 47, 59, 67 Response2AxisBaselineModel tag (sas) 107–108 response2AxisLowerThreshold attribute 46–47, 58–59 Response2AxisModel tag (sas) 100–111 response2AxisUpperThreshold attribute 47, 59 ResponseAxisBaselineModel tag (sas) 107–108 responseAxisLowerThreshold attribute 47–48, 60 ResponseAxisModel 109
ResponseAxisModel tag (sas) 100–111 responseAxisUpperThreshold attribute 48, 60–61 responseLabelVisiblePolicy attribute 85 responseVariableName attribute 16–17 reverseDirection attribute 86, 106 ringed pie charts 6, 22 ROTATE parameter, G3D procedure 291–292, 298 RowAxisModel tag (sas) 110–111 RS option, ODS statement 150 RS=NONE option, ODS statement 150
S SAS AppDev Studio 2 custom tags 15–17 tag libraries 3–8 tag prefix 15 SAS AppDev Studio 3 custom tags 18–24 graph model tags 39–97 reports 301–306 standard convention for tags 14 tag libraries 3–8 tag prefix 15 SAS/CONNECT 8, 146, 148 SAS/GRAPH 150–151, 173, 182–186 SASGraphLineStyle attribute 132 scatter charts 17 scatter plots as 3-D graphs 166 ScatterPlot tag (sas) 24 ScatterPlotModel tag (sas) 92–97 SIZE parameter 293–294 SCATTER statement, G3D procedure 205, 240, 298 Scatter tag (sasads) 7, 17 ScatterChart tag (sas) 5 ScatterPlot tag (sas) 7, 24 ScatterPlotModel tag (sas) antialiasedGraphics attribute 92 antialiasedText attribute 92 AxisWallModel tag (sas) and 119
Index 337
BackgroundFillStyle tag (sas) and 123 bottomMarkerLabelContent attribute 92–93 corresponding axis models 110–111 corresponding legend models 113 corresponding line styles 116 corresponding text style tags 117–118 fillAreaEnabled attribute 93 interpolationEnabled attribute 93–94 markerEnabled attribute 94 matchErrorColor attribute 95 maxMarkerSize attribute 95 minMarkerSize attribute 95 nesting 92 skipMissing attribute 95 syntax 92 topMarkerLabelContent attribute 96–97 xBaseline attribute 97 y2Baseline attribute 97 yBaseline attribute 97 scope attribute 14 scriplet coding 146, 148–149 SegmentedBar tag (sasads) 5, 17 ShadowStyle tag (sas) 136 SHAPE parameter G3D procedure 292, 298 GCHART procedure 261, 267 GMAP procedure 276–277 ShapeLegendModel tag (sas) 111–112 SHOWBACKDROP parameter, ODS statement 178–179 SHOWLEGEND parameter, ODS statement 211 SIDE parameter, G3D procedure 293, 298 size attribute 134, 139 SIZE parameter, G3D procedure 293–294, 298 SKIPMISS parameter, GPLOT procedure 286–287, 289 skipMissing attribute 72–73, 95 SLICE parameter, GCHART procedure 261, 267 sliceOrder attribute 86–87
SocketListener object 146, 148–149 softness attribute 136 solidBlendColor attribute 122, 129 SPACE parameter, GCHART procedure 262, 267 spaces See white space stackBarPolicy attribute 49–50, 61–62 stacked bar charts BarChart tag (sas) 18 SegmentedBar tag (sasads) 17 stackBarPolicy attribute 49–50, 61–62 stackLinePolicy attribute 62, 67 stackLinePolicy attribute 63, 67 STAR chart type, GCHART procedure 159, 225–226, 264–267 startAngle attribute 87, 91 startOffset attribute 106 StrokeLineStyle tag (sas) 130–132 SUBGROUP parameter, GCHART procedure 262–263 corresponding chart types 267 DETAIL parameter and 247 EXPLODE parameter and 250 NOLEGEND parameter and 258 SubgroupLabelModel tag (sas) 124 subGroupVariableName attribute 16–17 Submit tag (sas) 146–147, 149 SubmitInterface object 146 SUMVAR parameter, GCHART procedure 155, 157, 263, 267 supporting tags fill tags 126–130 line tags 130–133 miscellaneous tags 137–141 text tags 133–136 tick mark tags 136–137 surface maps 163 surface plots 167 symbol attribute 139–140 SYMBOL statement 278
338 Index
T tag libraries 3–8, 148 tags See also axis model tags See also graph model tags backslash in 14 custom 15–24 fill 126–130 JDBC support 8 legend model 111–113 line 130–133 line style 113–116 miscellaneous 137–141 nesting 14 ODS statement 307–310 prefixes for 15 sas 4–5 SAS AppDev Studio 3 tags 301–306 SAS AppDev Studio convention 14 sasads 4–5 text 133–136 text style 116–118 tick mark 136–137 text applying to graph area 30–31, 34–35 defining output height 216 smoothing edges of 50, 64, 68, 76, 88, 92 text parameters G3D procedure 239–240 GCHART procedure 217–226 GCONTOUR procedure 227–231 GMAP procedure 232–234 GOPTIONS procedure 214–217 GPLOT procedure 234–238 ODS statement 208–213 text/text style tags baselineAngle attribute 117 color attribute 117, 135 corresponding graph models 117–118 Font tag (sas) 133–134 justification attribute 117, 135 LabelTextStyle tag (sas) 134–135 nesting 116–118
ShadowStyle tag (sas) 136 TextStyle tag (sas) 136 ValueTextStyle tag (sas) 134–135 TextStyle tag (sas) 136 textures, applying predefined 28 thickness attribute 115, 132 3-D graphs See also G3D procedure CFILL parameter 188 CFR parameter 189 CFRAME parameter 189 CLIPREF parameter 245 dimension attribute 43, 54, 76 FRONTREF parameter 251 GCHART parameter support 192 HBAR3D chart type 192, 225–226 pie charts 158 PIE3D chart type 192, 225–226 prism maps 162 scatter plots 166 surface plots 167 VBAR3D chart type 192, 225–226 vertical bar charts 156 threshold values otherThreshold attribute 83 response2AxisLowerThreshold attribute 46–47, 58–59, 67 response2AxisUpperThreshold attribute 47, 59, 67 responseAxisLowerThreshold attribute 47–48, 60, 67 responseAxisUpperThreshold attribute 48, 60–61, 67 tick mark tags 136–137 tick marks AUTOHREF parameter 279 AUTOVREF parameter 279 continuousMajorTickAnchor attribute 101 continuousMajorTickCount attribute 101 continuousMajorTickInterval attribute 102 continuousMajorTickPositionPolicy attribute 102 continuousMajorTickValues attribute 103
Index 339
continuousMinorTickCount attribute 103 GRID parameter 281, 290 HMINOR parameter 268, 282 LAUTOHREF parameter 283 LAUTOREF parameter 254 MajorTickStyle tag (sas) 136–137 MinorTickStyle tag (sas) 136–137 NOAXES parameter 257 VM parameter 287 VMINOR parameter 271, 287 XTICKNUM parameter 271, 295 YTICKNUM parameter 272, 295–296 ZTICKNUM parameter 296 TILT parameter, G3D procedure 294, 298 time intervals 105 TIPBACKCOLOR parameter, ODS statement 179 TIPBORDERCOLOR parameter, ODS statement 180 TIPMODE parameter, ODS statement 212 TIPS parameter, ODS statement 212 TIPTEXTCOLOR parameter, ODS statement 180–181, 213 TITLE1 statement 215–217 topMarkerLabelContent attribute 73–74, 96–97 TopMarkerLabelTextStyle tag (sas) 116–117 TRANSPARENCY option, GOPTIONS statement 186 TYPE parameter, GCHART procedure 263, 267
U uniformAxes attribute 91
V value attribute 137 ValueTextStyle tag (sas) 134–135 variables category 10 chart 10 contiguous 10, 21
depth 74 discrete 11, 20–21, 248, 274 Java 149–150 plots and 163 response 10, 275 VAXIS parameter GCONTOUR procedure 231 GPLOT procedure 237–238 VBAR chart type 155–156 CFREQ parameter and 218 CPERCENT parameter and 218 GCHART procedure 192, 225–226, 264–267 MEAN parameter and 223 orientation attribute 45 PERCENT parameter and 224 star charts and 159 VBAR3D chart type, GCHART procedure 192, 225–226, 264–267 vertical axis See Y axis vertical bar charts See VBAR chart type verticalSpace attribute 36 VM parameter GCONTOUR procedure 271 GPLOT procedure 287 VMINOR parameter GCONTOUR procedure 271 GPLOT procedure 287, 289 VREF parameter GCONTOUR procedure 273 GPLOT procedure 288–289 VREVERSE parameter GCONTOUR procedure 231 GPLOT procedure 238 VZERO parameter, GPLOT procedure 288–289
W WallFillStyle attribute 118 WallFillStyle tag (sas) 126–130 webAF 3
340 Index
white space adding to graphs 33, 36 barWidthSpace attribute 42, 53 GSPACE parameter 253 horizontalSpace attribute 33 setting width of 42 verticalSpace attribute 36 width attribute 36–37 WIDTH parameter, GCHART procedure 264, 267 WOUTLINE parameter GCHART procedure 267 GMAP procedure 278
X x attribute 122, 129 X axis AUTOHREF parameter 279 contour plots 159–160 defined 11 HAXIS parameter 228, 236 HREF parameter 282 HREVERSE parameter 228, 236–237 HZERO parameter 283 LAUTOHREF parameter 283 LHREF parameter 285 xAxisBaseline attribute 74 XAxisModel tag (sas) 100, 110 xBaseline attribute 97 XTICKNUM parameter 271, 295 XAxisModel tag (sas) 100–111 xBaseline attribute 97 XLIGHT parameter, GMAP procedure 278 XPIXELS option, GOPTIONS statement 150, 208–209 XSIZE parameter, GMAP procedure 278 XTICKNUM parameter G3D procedure 295, 298 GCONTOUR procedure 271
XVIEW parameter, GMAP procedure 277 XYTYPE parameter, G3D procedure 298
Y y attribute 122, 129 Y axis AUTOVREF parameter 279 contour plots 159–160 defined 11 LAUTOVREF parameter 284 LVREF parameter 285 VAXIS parameter 231, 237–238 VM parameter 287 VMINOR parameter 287 VREF parameter 288 VREVERSE parameter 231, 238 VZERO parameter 288 y2AxisBaseline attribute 74 Y2AxisModel tag (sas) 100, 110 y2Baseline attribute 97 yAxisBaseline attribute 74 YAxisModel tag (sas) 100, 110 yBaseline attribute 97 YTICKNUM parameter 272, 295–296 y2AxisBaseline attribute 74 Y2AxisModel tag (sas) 100–111 y2Baseline attribute 97 yAxisBaseline attribute 74 YAxisModel tag (sas) 100–111 yBaseline attribute 97 YLIGHT parameter, GMAP procedure 278 YPIXELS option, GOPTIONS statement 150, 208–209 YSIZE parameter, GMAP procedure 278 YTICKNUM parameter G3D procedure 295–296, 298 GCONTOUR procedure 272 YVIEW parameter, GMAP procedure 277
Index 341
Z Z axis (depth variable) defined 11 ROTATE parameter 291–292 ZMAX parameter 297 ZMIN parameter 297 ZTICKNUM parameter 296 zeroHeightBarsVisible attribute 63 ZMAX parameter, G3D procedure 297–298 ZMIN parameter, G3D procedure 297–298 ZTICKNUM parameter, G3D procedure 296, 298 ZVIEW parameter, GMAP procedure 277
342 Index
Books Available from SAS Press
Advanced Log-Linear Models Using SAS®
The Cartoon Guide to Statistics
by Daniel Zelterman
by Larry Gonick and Woollcott Smith
Analysis of Clinical Trials Using SAS®: A Practical Guide by Alex Dmitrienko, Geert Molenberghs, Walter Offen, and Christy Chuang-Stein
Categorical Data Analysis Using the SAS ® System, Second Edition by Maura E. Stokes, Charles S. Davis, and Gary G. Koch
Annotate: Simply the Basics by Art Carpenter
Cody’s Data Cleaning Techniques Using SAS® Software
Applied Multivariate Statistics with SAS® Software, Second Edition
by Ron Cody
by Ravindra Khattree and Dayanand N. Naik
Common Statistical Methods for Clinical Research with SAS ® Examples, Second Edition by Glenn A. Walker
Applied Statistics and the SAS ® Programming Language, Fifth Edition by Ronald P. Cody and Jeffrey K. Smith
The Complete Guide to SAS ® Indexes by Michael A. Raithel
An Array of Challenges — Test Your SAS ® Skills
Data Management and Reporting Made Easy with SAS ® Learning Edition 2.0
by Robert Virgile
by Sunil K. Gupta
Building Web Applications with SAS/IntrNet®: A Guide to the Application Dispatcher
Data Preparation for Analytics Using SAS® by Gerhard Svolba
by Don Henderson
Carpenter’s Complete Guide to the SAS® Macro Language, Second Edition
Debugging SAS ® Programs: A Handbook of Tools and Techniques by Michele M. Burlew
by Art Carpenter
Carpenter’s Complete Guide to the SAS® REPORT Procedure
Decision Trees for Business Intelligence and Data Mining: Using SAS® Enterprise MinerTM by Barry de Ville
by Art Carpenter
support.sas.com/pubs
Efficiency: Improving the Performance of Your SAS ® Applications
Learning SAS ® by Example: A Programmer’s Guide by Ron Cody
by Robert Virgile
Learning SAS ® in the Computer Lab, Second Edition Elementary Statistics Using JMP® by Sandra D. Schlotzhauer
The Essential Guide to SAS ® Dates and Times by Derek P. Morgan
Fixed Effects Regression Methods for Longitudinal Data Using SAS® by Paul D. Allison
Genetic Analysis of Complex Traits Using SAS ® by Arnold M. Saxton
A Handbook of Statistical Analyses Using SAS®, Second Edition by B.S. Everitt and G. Der
Health Care Data and SAS® by Marge Scerbo, Craig Dickstein, and Alan Wilson
by Rebecca J. Elliott The Little SAS ® Book: A Primer by Lora D. Delwiche and Susan J. Slaughter The Little SAS ® Book: A Primer, Second Edition by Lora D. Delwiche and Susan J. Slaughter (updated to include SAS 7 features) The Little SAS ® Book: A Primer, Third Edition by Lora D. Delwiche and Susan J. Slaughter (updated to include SAS 9.1 features) The Little SAS ® Book for Enterprise Guide® 3.0 by Susan J. Slaughter and Lora D. Delwiche The Little SAS ® Book for Enterprise Guide® 4.1 by Susan J. Slaughter and Lora D. Delwiche
by Thomas Miron
Logistic Regression Using the SAS® System: Theory and Application by Paul D. Allison
In the Know... SAS® Tips and Techniques From Around the Globe, Second Edition
Longitudinal Data and SAS®: A Programmer’s Guide by Ron Cody
The How-To Book for SAS/GRAPH ® Software
by Phil Mason
Instant ODS: Style Templates for the Output Delivery System by Bernadette Johnson Integrating Results through Meta-Analytic Review Using SAS® Software by Morgan C. Wang and Brad J. Bushman
Introduction to Data Mining Using SAS® Enterprise MinerTM by Patricia B. Cerrito
support.sas.com/pubs
Maps Made Easy Using SAS® by Mike Zdeb Models for Discrete Date by Daniel Zelterman
Multiple Comparisons and Multiple Tests Using SAS® Text and Workbook Set (books in this set also sold separately) by Peter H. Westfall, Randall D. Tobias, Dror Rom, Russell D. Wolfinger, and Yosef Hochberg
Multiple-Plot Displays: Simplified with Macros by Perry Watts
Multivariate Data Reduction and Discrimination with SAS ® Software by Ravindra Khattree and Dayanand N. Naik
Output Delivery System: The Basics by Lauren E. Haworth
Painless Windows: A Handbook for SAS ® Users, Third Edition by Jodie Gilmore (updated to include SAS 8 and SAS 9.1 features)
Pharmaceutical Statistics Using SAS®: A Practical Guide Edited by Alex Dmitrienko, Christy Chuang-Stein, and Ralph D’Agostino
The Power of PROC FORMAT by Jonas V. Bilenas
by Kirk Paul Lafler
SAS ® for Forecasting Time Series, Second Edition by John C. Brocklebank and David A. Dickey
SAS ® for Linear Models, Fourth Edition by Ramon C. Littell, Walter W. Stroup, and Rudolf Freund
SAS ® for Mixed Models, Second Edition by Ramon C. Littell, George A. Milliken, Walter W. Stroup, Russell D. Wolfinger, and Oliver Schabenberger
SAS® for Monte Carlo Studies: A Guide for Quantitative Researchers by Xitao Fan, Ákos Felsovályi, Stephen A. Sivo, ˝ and Sean C. Keenan
by Ron Cody
SAS ® Guide to Report Writing, Second Edition
PROC TABULATE by Example by Lauren E. Haworth
Professional SAS® Programmer’s Pocket Reference, Fifth Edition by Rick Aster
Professional Second Edition
by Keith E. Muller and Bethel A. Fetterman
SAS ® Functions by Example
PROC SQL: Beyond the Basics Using SAS®
SAS ®
Regression and ANOVA: An Integrated Approach Using SAS ® Software
by Michele M. Burlew
SAS ® Macro Programming Made Easy, Second Edition by Michele M. Burlew
SAS ® Programming by Example Programming Shortcuts,
by Rick Aster
Quick Results with SAS/GRAPH ® Software by Arthur L. Carpenter and Charles E. Shipp
by Ron Cody and Ray Pass
SAS ® Programming for Researchers and Social Scientists, Second Edition by Paul E. Spector
SAS ® Programming in the Pharmaceutical Industry by Jack Shostak
Quick Results with the Output Delivery System by Sunil Gupta
Reading External Data Files Using SAS®: Examples Handbook
SAS® Survival Analysis Techniques for Medical Research, Second Edition by Alan B. Cantor
by Michele M. Burlew
support.sas.com/pubs
SAS ® System for Elementary Statistical Analysis, Second Edition
Univariate and Multivariate General Linear Models: Theory and Applications Using SAS ® Software
by Sandra D. Schlotzhauer and Ramon C. Littell
by Neil H. Timm and Tammy A. Mieczkowski
SAS ® System for Regression, Third Edition
Using SAS ® in Financial Research
by Rudolf J. Freund and Ramon C. Littell
by Ekkehart Boehmer, John Paul Broussard, and Juha-Pekka Kallunki
SAS ® System for Statistical Graphics, First Edition
Using the SAS ® Windowing Environment: A Quick Tutorial
by Michael Friendly
by Larry Hatcher
The SAS ® Workbook and Solutions Set (books in this set also sold separately) by Ron Cody
Visualizing Categorical Data
Selecting Statistical Techniques for Social Science Data: A Guide for SAS® Users
Web Development with SAS® by Example, Second Edition
by Michael Friendly
by Frank M. Andrews, Laura Klem, Patrick M. O’Malley, Willard L. Rodgers, Kathleen B. Welch, and Terrence N. Davidson
Statistical Quality Control Using the
SAS ®
System
by Dennis W. King
by Frederick E. Pratter
Your Guide to Survey Research Using the SAS ® System by Archer Gravely
Statistics Using SAS ® Enterprise Guide® by James B. Davis
JMP® Books
A Step-by-Step Approach to Using the SAS ® System for Factor Analysis and Structural Equation Modeling
JMP ® for Basic Univariate and Multivariate Statistics: A Step-by-Step Guide
by Larry Hatcher
by Ann Lehman, Norm O’Rourke, Larry Hatcher, and Edward J. Stepanski
A Step-by-Step Approach to Using SAS ® for Univariate and Multivariate Statistics, Second Edition by Norm O’Rourke, Larry Hatcher, and Edward J. Stepanski
Step-by-Step Basic Statistics Using SAS ®: Student Guide and Exercises (books in this set also sold separately) by Larry Hatcher
Survival Analysis Using SAS ®: A Practical Guide by Paul D. Allison
Tuning SAS ® Applications in the OS/390 and z/OS Environments, Second Edition by Michael A. Raithel
support.sas.com/pubs
JMP ® Start Statistics, Third Edition by John Sall, Ann Lehman, and Lee Creighton
Regression Using JMP ® by Rudolf J. Freund, Ramon C. Littell, and Lee Creighton