BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi There
Is there any proc in SAS that can create one bar and 2 lines in a graph. I tried proc gbarline but looks like it will only create a single bar and line combination.

Another question: I am trying to create a chart which is easy to create in excel but I am finding hard to create it in SAS.It's 2 bar and a line graph ( for e.g. I have 3 channels air, land ,sea and each channel has it's own averge,forcasted average, bench mark averge. I would like create 2 bars for each channel( own average,forcated avergae) and a line for the bench mark avergae. Is this possible with SAS grpah? I tried few options but didn't go anywhere. Any help would be greatly appreciated.

Thanks in Advance
Suren
3 REPLIES 3
deleted_user
Not applicable
I believe the available procedures "out of the box" will not produce what you need. However, anything you create with GPlot, GChart or any other SAS/Graph procedure can be extended with additional elements drawn with graphic annotation. The Procedure GAnno will do that for you.

You start by drawing your double bars, and then annotate the line over the bars to get the combination.

I can't give you any example without specific data and more time than I can devote to casually contributing here. However, if you get your two bars drawn and then spend some time reading and experimenting with the GAnno procedure documentation, I am sure you will get to a solution.


You might also search support.sas.com for GAnno and GChart and look for conference papers that might have examples to give you start-up pieces of code specific to your needs. Note that the online documentation for the procedures also includes extensive examples that you can copy and paste into a program and customise.

Kind regards

David
deleted_user
Not applicable
Thanks for the direction david. will try

S
Bill
Quartz | Level 8
The code below produces 2 bars (one inside the other) and one line. The bars are produced by using the symbol i=needle. This is an alternate to annotate.



symbol1 c=black i=needle v=none w=125 L=1;
symbol2 c=blue i=needle v=none w=75 L=1;
symbol3 c=red i=join v=square w=25 L=2;

axis1 order=(%ord) offset=(5,5) pct
label=('Campaign Start Week');
axis2 order=(0 to 12000 by 3000) offset=(0,0) pct
label=(a=90 'Tons');
axis3 c=red order=(40 to 100 by 20) offset=(0,0) pct
label=(a=90 'Percent on Order');
;
proc gplot data=all;
format weekstrt date7.;
plot (wip inspectd)*weekstrt /overlay
haxis=axis1
vaxis=axis2
;
plot2 onordfin*weekstrt/vref=87.6
vaxis=axis3;
run;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 621 views
  • 0 likes
  • 2 in conversation