简体   繁体   中英

Piecharts with different sizes according to sample size in SAS

I want to create a matrix of pie charts with different sizes (pie chart diameter) according to sample size. Basically I want to know if there is an option that, with the code I present, makes each pie chart have a different diameter according to total sales number.

Thanks in advance,

goptions device=gif gsfname=chart hpos=100 vpos=100 htext=2 ftext=zapfb ;

data example4 ;
INFILE DATALINES DSD DLM='#'; 
input season $ flavor $ sales ;
datalines ;
Winter # Apple # 1675
Winter # Banana Cream # 164
Winter # Blueberry # 137
Winter # Cherry # 966
Fall # Banana Cream # 209
Fall # Blueberry # 146
Fall # Cherry # 1059
Fall # French Silk # 258
Summer # Apple # 1466
Summer # Banana Cream # 209
Summer # Blueberry # 146
Summer # Cherry # 1059
Spring # Pecan # 759
Spring # Pumpkin # 1254
Spring # Rhubarb # 318
Spring # Sweet Potato # 307
;
run ; 

filename chart "C:\My Documents\Graphs\example4.gif" ;
proc gchart data=example4 ;
title "Example 4: Most Frequently Purchased Pies by Season" ;
pie flavor / sumvar=sales noheading slice=inside value=none percent=inside
fill=solid cfill=STYBR other=5 otherlabel="All Others" group=season
across=2 down=2 ;
footnote "The 'All Others' slice contains pies purchased < 5% of the time";
run ;
quit ;

万一有人遇到这个问题,我最终使用greplay,将饼图并排放置,并使用radius选项根据我的需要缩放比例。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM