Posted By

webonomic on 03/31/08


Tagged

pie charts


Versions (?)

Display Percentages in Pie Charts


 / Published in: SAS
 

URL: http://jaredprins.squarespace.com/blog/2008/3/31/pie-charts-and-displaying-percentages.html

  1. /*This will display a pie chart with the % sign behind the values*/
  2.  
  3. data have;
  4. input Id Name $ Percent;
  5. percent=round(percent);
  6. cards;
  7. 1 Jim 39.1234
  8. 1 John 60.8766
  9. 2 Jim 21.2345
  10. 2 Jack 33.5555
  11. 2 John 46.21
  12. 3 Josh 100
  13. 4 Jack 11.56
  14. 4 Jim 15.6543
  15. 4 John 25.1
  16. 4 Josh 47.6857
  17. ;
  18. run;
  19.  
  20.  
  21. proc gchart data=have;
  22. format percent 3.0;
  23. pie Name / discrete sumvar=Percent
  24. NOLEGEND
  25. SLICE=ARROW
  26. /* PERCENT=INSIDE */
  27. /* VALUE=NONE */
  28. COUTLINE=BLACK;
  29. by Id;
  30. run;
  31. quit;

Report this snippet  

You need to login to post a comment.