BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mona4u
Lapis Lazuli | Level 10

I have this dataset and I want to produce a bar chart like this 

 

 bar chart.PNG

Can you please help me with this my first time doing a bar chart

 

ObsSite_InitiatedSite_Approved1Date_Supplied4site_contracted
1396734

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26
vbar Vname/type=sum sumvar=vvalue1234;
--
Paige Miller

View solution in original post

13 REPLIES 13
PaigeMiller
Diamond | Level 26

Explain what bar chart you want.

 

I don't see these variables as belonging on a single bar chart.

--
Paige Miller
mona4u
Lapis Lazuli | Level 10

I just edited the question 

PaigeMiller
Diamond | Level 26

There are a number of examples shown for PROC GCHART. Please give it a try and if you can't get it to work, show us your code.

 

http://documentation.sas.com/?cdcId=pgmmvacdc&cdcVersion=9.4&docsetId=graphref&docsetTarget=n1dvg3qp...

 

There are a number of examples show for PROC SGPLOT. See if any of those get's you the results you want.

 

http://documentation.sas.com/?cdcId=pgmmvacdc&cdcVersion=9.4&docsetId=graphref&docsetTarget=n1dvg3qp...

--
Paige Miller
mona4u
Lapis Lazuli | Level 10

This is the chart that I got from changing the data structure and  using this code 

 

this is the dataset 

Obs Vname Vvalue1234

Site_Initiated39
Site_Approved16
Date_Supplied47
site_contracted34

 

this is the code 

proc gchart data=set5;

vbar Vname;

run;

 

this is the chart 

Capture set5.PNG

DanH_sas
SAS Super FREQ

change VBAR to VBAR3D in your PROC GCHART, and you should get a similar chart to your original post.

PaigeMiller
Diamond | Level 26

Let me strongly un-recommend the 3D option. 

 

Just because you CAN make 3D bar charts with SAS software does not mean that you SHOULD make 3D bar charts. 3D bar charts are very difficult to interpret and often misleading.

--
Paige Miller
DanH_sas
SAS Super FREQ

I do agree with Paige. If you want a 3-D'ish appearance on your bars without obscuring in the information, trying using a DATASKIN. Run this and see what you think:

 

data temp;
input measure $ 1-15 value;
cards;
Site_Initiated	 39
Site_Approved1	  6
Date_Supplied4	  7
site_contracted	34
;
run;

proc sgplot data=temp;
vbar measure / response=value dataskin=pressed;
run;
mona4u
Lapis Lazuli | Level 10

Thanks for your answer. This way worked too but I can't accept more than one answer. 

PaigeMiller
Diamond | Level 26
vbar Vname/type=sum sumvar=vvalue1234;
--
Paige Miller
mona4u
Lapis Lazuli | Level 10

I want to change the default here 

Do you have an idea how I can do it? Capture chart.PNG 

PaigeMiller
Diamond | Level 26

@mona4u wrote:

I want to change the default here 

Do you have an idea how I can do it? Capture chart.PNG 


Use the LABEL statement.

--
Paige Miller
mona4u
Lapis Lazuli | Level 10
Thanks.
I want to adjust the size and the location
because I'm creating a report and I want it to on the right of the table
AhmedAl_Attar
Ammonite | Level 13

Hi,
You probably would have an easier way to chart it, if you data set was structured like this

Measure Value
Site_Initiated 39
Site_Approved1 6
Date_Supplied4 7
site_contracted 34

 

Hope this helps,

Ahmed

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 13 replies
  • 2511 views
  • 9 likes
  • 4 in conversation