BookmarkSubscribeRSS Feed
venkatesh
Calcite | Level 5
Hi All.,

I Have data set called emp, fields are emp name, salar;
i want to display the report

bottom of the bar name and top of the bar is salary.,

example

Y
|
venkat|------------------------------------------------- 5000
|
|
|---------------------------------------------------------------------------------X


here venkat is the name and 5000 is salary, similar way i have 500 records...
have to display all the records in a graph.....
may be it is easy but am un able to do it....pls

Thanks a lot...
3 REPLIES 3
Doc_Duke
Rhodochrosite | Level 12
Doing what you describe takes some sophisticated programming using the ANNOTATE facility in SAS. It also makes for a distorted visual image (see Cleveland's graphics book).

An alternative that is much easier and not distorted is to concatenate the salary to the name, like "venkat, 5000", and then do a horizontal bar chart with the DISCRETE option (I'm not sure that it will display 500 bars).
venkatesh
Calcite | Level 5
Pls Provide a Small exapmle....


Thanks.
RichardH_sas
SAS Employee
Agreed with Doc: it takes some work to get the person's name inside the bar as you describe. You could use your Emp Name in Columns to chart role and the Salary in the Sum of role -- that would get you the person's name not inside the bar but to the left on the axis. Getting the data values is under Advanced in the Bar Chart task: check show statistics next to bar and check additional statistics next to bar: sum.

I tried this with a data set that had 424 rows -- it required tweaking the code with a "levels=all" option on the HBAR3D statment, and honestly the results looked awful. All the bars were really packed in making it impossible to see any detail. Once you get to the bar chart, you could contact SAS Tech Support (http://support.sas.com/techsup/contact/) to see about make the charting area bigger, or, probably a better idea would be to break things up by some other variable like department into smaller graphs. If you had a Department value, that could go in the Group charts by role in the Bar Chart task.

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 3 replies
  • 799 views
  • 0 likes
  • 3 in conversation