Reinventing the Pie Chart: Improved and Reliable Communication for This Popular Business Chart LeHoy Bessler, Miller Brewing Company Abstract and Introduction Area Fill for Pie Slices The SAS/GRAPH' implementation of the Pie Chart can result in disappearing text for SLICE (name), VALUE, and PERCENT (of whole) when a slice becomes too small or when too many small slices are adjacent. For a simple pie chart, especially if without a legend, the best area fill is EMPTY. However, for a presentation, solid color may be more picturesque. In any case, never use parallel lines or cross-hatching. Gray shades or solid colors are the best area fill. Combining small slices into a non-informative 'OTHER" slice may be unacceptable. The desired order of slices may be an essential requirement, or rearranging slices may not help. Order of Pie Slices The SAS/GRAPH default order of pie slices· is by slice name. If SAS Institute enhances PROC GCHART with a pie legend option, that will not suffice unless all three items--SLlCE, VALUE, and PERCENT--can appear in the legend. But it is better to use the (by) DESCENDING (size) option, to order the attention of the viewer. "De-alphabetizing" the DESCENDING Feature After struggling with this situation for years, and developing an Enhanced Horizontal Bar Chart to reliably provide all the features (except geometric) of the Pie Chart, a simple solution--which requires an unexpectedly relevant feature of Version 6--finally occurred to me. The solution also eliminates the 16-character limit on SLICE names, a long-regretted obstacle to elegant and clear communication. To specify the area fill for pie slices, you need to provide pattern statements, which are identified as PATTERN1,PATTERN2, etc. Even if you specify DESCENDING order for pie slices, the PATTERNn area fills are always applied by SAS/GRAPH to slices in alphabetic order of slice name. The physical, DESCENDING-size order of the slices is disregarded. A method for pie legend generation is shown here, but not "macro-ized". It uses hard-coding, rather than having PERCENT, VALUE, and SLICE built and passed as global variables, and having the legend headings supplied as macro parameters. I leave macro-ization as an exercise for the reader. A pie chart looks best if you order gray-shaded slices from lightest to darkest, particularly for the DESCENDING option. This paper covers above-described and other "Problems and Perils of the Pie Chart", and how to overcome them. To aChieve this, you must first determine the "size order for slice names", and then specify PATTERNn gray shades accordingly. (See Appendix B and Figure 4.) When No Pie Chart Will Work Pie Labels The Enhanced Horizontal Bar Chart (Figure 2) is needed if there are too many categories for a pie. It provides image and detail optimally combined: category name; percent of whole; graphic depiction of relative size; and value (ranked). But it can't present share-of-whole in the intrinsic geometric manner of the pie chart. For the code to do this bar chart, see my paper "Show Them What's Important: Design and Construct Tables, Lists, Reports, and Other Displays for Effective Communication", elsewhere in these Proceedings. I recommend NOHEADING. Do not match the color of a label to that of slice--e.g., yellow text on white paper is impossible to read. Black is usually the best color for text. SAS/GRAPH appends .0 to integer VALUEs. Suppress this with a FORMAT statement. For the New, Improved Pie Chart, text and numbers are in the legend; you specify SLICE-NONE, PERCENT=NONE, and VALUE~NONE. Pie Chart PERCENT Feature Perversity The essential trick to the "Basic" Enhanced Horizontal Bar Chart (not Figure 2). is to concatenate percent-of-whole into the 16-character bar name variable. But, for Figure 2, the longer bar name is annotated. Also, NOSTATS is specified, and the bar values are annotated at the bar ends, instead of taking the default column at the margin. PERCENT is only displayed at tenths or hundredths. If the input VALUE is in tenths, the PERCENT will be in tenths. If the input VALUE is in hundredths, thousandths, or "finer", the PERCENT will be in hundredths. 1022 You can get the PERCENT to be in tenths for any VALUE finer than tenths. Reformat the input to give to GCHART by first rounding with the statement "TOGCHART - ROUND(VALUE,0.1);". SUJ)press SLICE, VALUE, and PERCENT. SAS/GRAPH may drop some ofthem anyhow. Use a Ieft-justified footnote for each Slice. Indent (uniformly) with leading blanks, if deSired. Use the MARKER font for a first character of 'U" in each footnote to produce the sample area-fill. Use a uniform-width font (e.g., CENTXU) for Percent of Whole, so that the digits, decimal points, and percent signs are aligned. However, if the input VALUE is integer, or integer with zero(s) to right of decimal point, SAS/GRAPH insists on displaying PERCENT to hundredths, no matter how you try to trick it For the New, Improved Pie Chart, the percent is in the legend; you specify PERCENT-NONE, The above remarks about PERCENT are irrelevant. Also use a uniform-width font for Value. If the slice name is at the end of the footnote, you may use a variable-width font (e.g., CENTX) without disturbing the alignment of the Percents or Values. Worst Peril of SAs/GRAPH Pie Charts (Figure 3) There is a limit of 8 pie slices ~.e., FOOTNOTE statements), or 1 pie slices if headings for the legend are not needed. ° The SAS/GRAPH implementation of the Pie Chart can result in disappearing text for SLICE (name), VALUE, and PERCENT (of whole) when a slice becomes too small orwhen too many small slices are adjacent For more slices, you have two choices. Use the Enhanced Horizontal Bar Chart. Or output the "naked" pie chart and a legend list made up of the needed number of NOTE statements into two separate GCAT entries, and then GREPLAY them throug h a composite template. The SAS/GRAPH code for the defective Pie Chart is shown in Appendix A As noted in the Abstract and Introduction, attempts at circumvention may be ineffeCtive. Just Say "No" to the 3D Designer Drug New, Improved Pie Chart (Figure 4) 3D for a pie chart is a frill that distorts the message. Please study the pie charts (not created with SAS/GRAPH) in Figure 1 to see my point As of Release 6.09, SAS/GRAPH does not support a Pie legend. If SAS/GRAPH someday does, it may not include all the features my New, Improved Pie Chart can provide. Notices SAS/GRAPH is a registered trademark or trademark of SAS Institute Inc. in the USA and other countries . • denotes USA registration. Fortunately, Version 6 provides the MARKER (MARKERE) font. Using it, the "letter" U prints as solid (empty) square. This enables you to produce a block of sample area fill for a legend entry. Author Dr. LeRoy Bessler P.O. Box 96 Fox POint, WI 53201-0096, USA Telephone : 414-351-6748 The SAS/GRAPH code for the New, Improved Pie Chart is shown in Appendix B. 5%---~ 11% 11% 19% ~~201 ~ 5% ..-1-.--. r---20% 5% 191 ---~--401 Figure 1. 3D Pie Chart Distorts Relative Sizes of Slices (Compare 2D) 1023 Appendix A: Code for Defective Pie Chart:--Uses only SAS/GRAPH defaults, except OTHER=O /~ statements for DATA Step, GOPTIONS, TITLEs, & FOOTNOTE ~/ PROC GCHART; PIE BEVERAGE / OTHER=O SUHVAR=GALLONS TVPE=SUH PERCENT=OUTSIDE; RUN; Appendix B: Code for New, Improved Pie Chart DATA; INFILE CARDS; INPUT aOl BEVERAGE $23. CARDS; Soft Drinks Beer Fruit Juices and Drinks Bottled Water Wine Spirits a25 GALLONS 4.1; 48.4 23.2 11.6 8.0 1.9 1.4 51. 270 24.570 12.370 8.570 2. OX 1. 570 RUN; /~ GOPTIONS statement here ~/ TITLEl F=CENTX H=1.5 J=C '1991 Relative Consumption of Beverages in Six Categories'; TITLE2 H=l.OO ' '; TITLE3 F=CENTX H=1.50 J=C 'Estimates from "Beverage World 1992-1993 Data Bank"'; TITLE4 H=0.25 IN ' '; FOOTNOTEl J=L H=1.50 F=CENTXU ' F=CENTXU ' , C=BLACK F=CENTXU 'Share F=CENTX 'Gallons' F=CENTXU' , F=CENTX 'Beverage Category'; , . , , FOOTNOTE2 J=L H=0.50 FOOTNOTE3 J=L H=1.50 F=CENTXU ,, F=MARKERE C=BLACK 'U' C=BLACK F=CENTXU 51. 270 - 48.4 F=CENTX ,'Soft, Drinks'; FOOTNOTE4 J=L H=1.50 F=CENTXU F=HARKER C=GRAVI 'U' C=BLACK F=CENTXU , 24.570 - 23.2 F=CENTX 'Beer' , j FOOTNOTES J=L H=1.50 F=CENTXU ,, F=HARKER C=GRAV2 'U' C=BLACK F=CENTXU 12.370 - 11.6 F=CENTX ,'Fruit , Juices and Drinks'; FOOTNOTE6 J=L H=1.50 F=CENTXU , F=HARKER C=GRAV3 'U' C=BLACK F=CENTXU 8.570 - 8.0 - , F=CENTX 'Bottled Water'; , FOOTNOTE7 J=L H=1.50 F=CENTXU ,, F=HARKER C=GRAV4 'U' C=BLACK F=CENTXU 2.070 - 1.9 F=CENTX 'Wine'j , , FOOTNOTE8 J=L H=1.50 F=CENTXU F=HARKER C=BLACK 'U' C=BLACK F=CENTXU , 1.570 - 1.4 F=CENTX 'Spirits' j FOOTNOTE9 H=0.50 IN ' '; FOOTNOTEI0 J=L H=l.l F=TRIPLEX , Figure 4. New, Improved Pie Chart'; PATTERN 1 C=GRAVI V=PSOLID; /~ Beer ~/ PATTERN2 C=GRAV3 V=PSOLID; /~ Bottled Water ~/ PATTERN3 C=GRAV2 V=PSOLID; /~ Fruit Drinks/Juices ~/ PATTERN4 C=WHITE V=PSOLID; /~ Soft Drinks ~/ PATTERNS C=BLACK V=PSOLID; /~ Spirits ~/ PATTERN6 C=GRAV4 V=PSOLID; /~ Wine ~/ PROC GCHART; PIE BEVERAGE / OTHER=O SUHVAR=GALLONS TVPE=SUH PERCENT=NONE CLOCKWISE COUTLINE = BLACK DESCENDING NOHEADING SLICE NONE VALUE NONE; RUN; 1024 State and Local Government Employment By State In October 1991 State Name, Percent of USA Total, and Employee Count 10.9% 1,429,149 California 8.6% 1,123,044 New York 7.2% 951,388 Texas 5.0% 657,460 Florida 4.3% 565,158 Illinois 4.0% 530,147 Ohio Pennsylvania 3.7% 485,736 Michigan 3.7% 480,402 3.2% 417,913 New Jersey 2.9% 383,290 Georgia 360,844 North Carolina 2.7% 2.6% 338,478 VirCiJinia 2.2% 288,789 Indl.ana Massachusetts 2.1% 278,831 2.0% 266,290 washington 1.9% 256,022 Wisconsin Tennessee 1.9% 249,897 1.9% 246,434 Missouri Maryland 1.9% 245,953 1.9% 244,064 Lousiana Minnesota 1.8% 235,058 1.8% 232,437 Alabama South Carolina 1.5% 200,233 1.5% 195,563 Kentucky Arizona 1.4% 189,447 1.4% 185,912 Colorado Oklahoma 1.4% 185,106 1.2% ummm 164,052 Iowa Oregon 1.2% mmmm 157,642 Connecticut 1.2% mmmm 155,718 Kansas 1.2% mmmm 154,745 1.2% mmmm 151,964 Mississippi Arkansas 0.9% mmm 123,132 New Mexico 0.8% IIIiIIIl!II 100,602 Nebraska 0.7% I!iIiIII 98,219 west Virginia 0.7% IIIIIIIII!I 91,332 Utah 0.7% IIIIIIIII!I 90,727 Maine 0.5% IIIIii1 64,582 Hawaii 0.5% IIIIlIII 64,390 Nevada 0.5% I11III 62,680 0.4% IIIIiII 57,164 Idaho Montana 0.4% II1II 52,006 New Hampshire 0.4% II1II 51,046 0.4% IIIiII 46,670 Rhode Island 0.3% l1li 43,978 Alaska South Dakota 0.3% Ii!iI 38,054 Delaware 0.3% II1II 36,997 Wyoming 0.3% l1li 35,780 North Dakota 0.3% III 35,581 Vermont 0.2% m 30,236 USA Total Figure 2. Annotated Ranked Horizontal Bar Chart: For When No Pie Chart Will Work 1025 = 13,130,342 1991 Per Capita Consumption of Beverages in Six Categories· Estimates from "Beverage World 1992 -1993 Data B3lJkI' SUM of GALLONS by BEVERAGE Bottled Water 8.0 8.47% Beer 23.2 24.55% Fruit Juices and 11.6 12.28% Spirits 1.4 1. 481 Soft Drinks 48.4 51.221 Figure 3. Defective Pie Chart: "Wine" label, value, percent Inissing, "Fruit Juices and Drinks" label truncated 1026 1991 Per Capita Consumption of Beverages in Six Categories Estimates from IIBeverage World 1992 -1993 Data BanlCl Share Gallons Beverage Category 51.2% 24.5% tI~ 12.3% ~ 8.5% II 2.0% 1.5% 48.4 23.2 11 . 6 8.0 1.9 1.4 Soft Drinks Beer Fruit Juices and Drinks Bottled Water 0 • • Wme Spirits Figure 4. New, Improved Pie Chart 1027
© Copyright 2026 Paperzz