Service Packs for the SAS9 Platform." />
SUPPORT / SAMPLES & SAS NOTES
 

Support

Sample 26116: Create a bullet graph indicator for a dashboard using a stored process

DetailsCodeOutputDownloadsAboutRate It

This sample uses the GCHART procedure in conjunction with the Annotate facility in the SAS/GRAPH software to create a single bullet graph indicator for use in a dashboard. This version is intended to run as a SAS stored process.

Note: Bullet graphs were invented by dashboard expert Stephen Few and are described in detail in Chapter 6 of Information Dashboard Design (Sebastopol, CA: O'Reilly Media, Inc., 2006).

For a sample of a complete dashboard, see Create a dashboard with multiple bullet graph indicators using a stored process.

To create a bullet graph similar to this sample, create a SAS data set that contains the following variables:

TITLETEXT
specifies the title or label above the bullet graph.
MYLABEL
specifies the bar midpoint label, which is displayed to the left of the bar.
ACTUAL
specifies the value for the dark bar that represents the actual value.
TARGET
specifies the value for the dark line that represents the target value.
RANGE1
specifies the maximum value of the first shaded area behind the bar.
RANGE2
specifies the maximum value of the second shaded area behind the bar.
RANGE3
specifies the maximum value of the third shaded area behind the bar.
VALUE_FORMAT
specifies the format that is to be used for the tick mark values on the axis.
BY_VALUE
specifies the tick mark increment for the values on the axis.

After you create your data set, run the %DO_BULLET macro, passing in as parameters the SAS data set name and the name of the graph. Here is an example:

%do_bullet(data1,bull1);

The %DO_BULLET macro uses the GCHART procedure to draw a horizontal bar chart (HBAR) in order to show the actual value as a dark bar. It then creates an Annotate data set that shades the three target ranges behind the bar using the Annotate BAR function in order to define the shaded rectangular areas. Finally, it annotates a thick line that represents the target value.

The %DO_BULLET macro assumes the base of the bar and the minimum of the first range is always zero. It also assumes that the bar value and target value for each fall within the viewable area that is covered by the three ranges.

For additional information about creating dashboard applications with SAS/GRAPH software, see SAS/GRAPH Dashboard Samples.




These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.