DATA Step, Macro, Functions and more

Plotting multiple Bar Charts next to each other

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 130
Accepted Solution

Plotting multiple Bar Charts next to each other

Hi,

 

I have a "Region_Location" on the X axis, and All HIV Cases, as wells reported HIV Cases which I want to be the frequency for the data, on the y axis. I would like to plot, for each location, the reported cases inside of a bar that has all the cases. So, for example, I can simply plot all the cases, for each region, like this:

 

Libname SasData '/folders/myfolders/SASData' ;  
      
Title "Reported AIDS Cases and All Estimated Persons Living with AIDS" ;

 

pattern1 value=empty ;
Proc gchart Data=SasData.HIV_Surveillance ;
Label   Residence_Location = 'Residence Location' ;
    Vbar Residence_Location / freq=All_Cases ;
run ;                       
quit ;

 

But I want to actually have, with a different pattern, pattern1 = empty, Pattern2 = R3, etc... the Reported cases inside the bar for all the cases. How do I do this. Nothing I have tried has worked so far . Thanks!

 

Below is the data file:

------------------------------------


/*HIV Surveillance Data 2014*/

Libname SasData '/folders/myfolders/SASData' ;
Data SasData.HIV_Surveillance ;
Input Residence_Location & $20.
      Reported_Cases     : 8.
      All_Cases          : 8. ;
Datalines ;
Atlanta         6355 14776
Baltimore       3490 10176
Boston          2769 9334
Chicago         5030 16037
Dallas          3312 9685
Detroit         1869 5289
Ft. Lauderdale  3218 9310
Houston         5034 13516
Los Angeles     7795 26799
Miami           4116 14399
Nassau          1190 3682
New Haven       873  4240
New Orleans     1558 4652   
New York        16046 66528
Newark          2435 7282
Orlando         1909 5555
Philadelphia    4150 14467
Phoenix         1756 4737
San Diego       1664 7327
San Francisco   2352 11264
San Juan        1829 6975
Tampa Bay       2118 6199
Washington DC   6440 19128
W.Palm Beach      1347 4991
;   

---------------------------------------


Accepted Solutions
Solution
‎03-16-2018 05:07 PM
Super User
Posts: 23,724

Re: Plotting multiple Bar Charts next to each other

Posted in reply to ManitobaMoose

All Replies
Frequent Contributor
Posts: 130

Re: Plotting multiple Bar Charts next to each other

Posted in reply to ManitobaMoose

SORRY.. THIS POST SHOULD READ: PLOTTING MULTIPLE BAR CHARTS INSIDE EACH OTHER If that is not possible, I could also plot them next to each other.

Solution
‎03-16-2018 05:07 PM
Super User
Posts: 23,724

Re: Plotting multiple Bar Charts next to each other

Posted in reply to ManitobaMoose
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 103 views
  • 1 like
  • 2 in conversation