Display Percentages in Pie Charts


/ Published in: SAS
Save to your folder(s)



Copy this code and paste it in your 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;

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.