I have this dataset and I want to produce a bar chart like this
Can you please help me with this my first time doing a bar chart
Obs | Site_Initiated | Site_Approved1 | Date_Supplied4 | site_contracted |
1 | 39 | 6 | 7 | 34 |
Explain what bar chart you want.
I don't see these variables as belonging on a single bar chart.
I just edited the question
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.
There are a number of examples show for PROC SGPLOT. See if any of those get's you the results you want.
This is the chart that I got from changing the data structure and using this code
this is the dataset
Obs Vname Vvalue1234
Site_Initiated | 39 |
Site_Approved1 | 6 |
Date_Supplied4 | 7 |
site_contracted | 34 |
this is the code
proc gchart data=set5;
vbar Vname;
run;
this is the chart
change VBAR to VBAR3D in your PROC GCHART, and you should get a similar chart to your original post.
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.
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;
Thanks for your answer. This way worked too but I can't accept more than one answer.
vbar Vname/type=sum sumvar=vvalue1234;
I want to change the default here
Do you have an idea how I can do it?
@mona4u wrote:
I want to change the default here
Do you have an idea how I can do it?
![]()
Use the LABEL statement.
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
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: