Adding a Header and Positioning the Inset

In the previous examples, the insets are displayed in the upper left corners of the plots, which is the default position for insets added to Pareto charts. You can control the inset position with the POSITION= option. In addition, you can display a header at the top of the inset with the HEADER= option. The following statements create a data set to be used with the INSET DATA= keyword and produce the horizontal Pareto chart shown in Figure 13.14:

data location;
   length _LABEL_ $ 10 _VALUE_ $ 12;
   input _LABEL_ _VALUE_ &;
datalines;
Plant     Santa Clara
Line      1
;
ods graphics off;
title 'IC Failures';
proc pareto data=Failure3;
   hbar Cause / 
      freq     = Counts
      maxncat  = 5;
   inset data = location n nexcl /
      height   = 3
      position = rm
      cshadow  = black
      header   = 'Count Summary';
run;

The header (in this case, Count Summary) can be up to 40 characters. Note that a longer list of inset statistics is requested. Consequently, POSITION=RM is specified to position the inset in the right margin so that it does not interfere with features of the chart. For more information about positioning, see Details: INSET Statement. The CSHADOW= option is used to display a drop shadow on this inset. The options, such as HEADER=, POSITION=, and CSHADOW=, are specified after the slash (/) in the INSET statement. For more details on INSET statement options, see Dictionary of Options.

Note that the contents of the data set location appear before other statistics in the inset. The position of the DATA= keyword in the keyword list determines the position of the data set’s contents in the inset.

Figure 13.14 Adding a Header and Repositioning the Inset
Adding a Header and Repositioning the Inset