The SAS Output Delivery System and reporting techniques

Bar chart in SAS EG 7.1

Reply
Regular Contributor
Posts: 165

Bar chart in SAS EG 7.1

I tried to create a bar chart (click on the dataset->Graph->Bar Chart) in SAS EG 7.1 but I'm unable to produce the bar chart in SAS as good as in MS Excel.

Any possibilities to produce the bar chart in EG as similar to the attachment which I did in Excel 2010.

Thanks in advance for your inputs.Excel bar chart.png

Esteemed Advisor
Esteemed Advisor
Posts: 6,726

Re: Bar chart in SAS EG 7.1

Hi,

Well, I dont use EG so cant comment specifically on the functionality, although a Google search had many help documents:

http://analytics.ncsu.edu/sesug/2009/HOW007.Thompson.pdf

Its a matter of learning Graph Template language and coding, you can then do most things with graphs.  For help learning that, have a look through this blog:

http://blogs.sas.com/content/graphicallyspeaking/

SAS Super FREQ
Posts: 8,645

Re: Bar chart in SAS EG 7.1

sgplot_headcount.bmpHi:

  You don't really need GTL for this simple bar chart. The SGPLOT procedure with the VBAR statement will do it. The KEYLEGEND statement gives you a chance to position the legend outside.

Cynthia

data headcount;

  length city $12;

  infile datalines;

  input City $ Headcount;

  label headcount='Head Count';

return;

datalines;

Bridgewater  110

Flemington  125

Hillsborough 130

Somerset    128

;

run;

proc sgplot data=headcount;

  vbar city / response=headcount name='HC';

  xaxis  label=' ';

  yaxis values=(0 to 140 by 20) label='Head Count' grid;

  keylegend 'HC' / location=outside position=right  ;

run;

(Note: I will post a screen shot when able to)

Regular Contributor
Posts: 165

Re: Bar chart in SAS EG 7.1

Thanks a ton.

Can't we do this with a simple drag & drop like I did earlier?

I tried to create a bar chart (click on the dataset->Graph->Bar Chart) in SAS EG 7.1

SAS Super FREQ
Posts: 8,645

Re: Bar chart in SAS EG 7.1

Hi:

  I thought you already knew how to create a Bar Chart in EG and wanted an alternative. Depending on what exactly you mean by "as good as in MS Excel" you may or may not have to use code. For example, I produced the screenshot below using the Graph Task in EG (after I ran a program to make the HEADCOUNT data).

cynthia

use_eg_bar_chart.png

Grand Advisor
Posts: 16,393

Re: Bar chart in SAS EG 7.1

Post under SAS EG instead of Graphs perhaps?

Code will always be more powerful than GUI.

You can check if EG has something called SGDesign which is available in SAS Base to customize graphs afterwards, which is point and click.

Post a Question
Discussion Stats
  • 5 replies
  • 521 views
  • 6 likes
  • 4 in conversation