BookmarkSubscribeRSS Feed
RamKumar
Fluorite | Level 6

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

5 REPLIES 5
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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/

Cynthia_sas
SAS Super FREQ

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)

RamKumar
Fluorite | Level 6

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

Cynthia_sas
SAS Super FREQ

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

Reeza
Super User

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.

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
  • 5 replies
  • 2081 views
  • 6 likes
  • 4 in conversation