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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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