Desktop productivity for business analysts and programmers

Displaying Salary Value end of the bar

Posts: 61

Displaying Salary Value end of the bar

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.,


venkat|------------------------------------------------- 5000

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...
Trusted Advisor
Posts: 2,114

Re: Displaying Salary Value end of the bar

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).
Posts: 61

Re: Displaying Salary Value end of the bar

Pls Provide a Small exapmle....

SAS Employee
Posts: 149

Re: Displaying Salary Value end of the bar

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 ( 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.
Ask a Question
Discussion stats
  • 3 replies
  • 3 in conversation