Click here to see the SAS code.
Click here to see the example.


Someone posted to Stephen Few's website discussion group
asking for suggestions on how to better visualize data such as the data
presented in the following graph on the bizviz graph website.

While I don't have any ideas for a better "type" of graph, I did
apply myself to improving upon the existing stacked bar chart.
Here is a list of improvements which I *hope* I've brought to the table...

o More discernable colors
o Easier to look at (without white strips between bars)
o More meaningful ordering of the bar segments (hopefully :)
o HTML text data tips when you hover over the bar segments.
o EU25 is hilighted with "-----", to make it stand out as "different".

Here's a list of the particular sas/graph features & tricks I use ...

I use SAS/ACCESS to pcff to read the data directly from the xls spreadsheet
into a sas dataset.  

I use "proc transpose" to turn columns into rows in the data structure,
so it can be used conveniently with "proc gchart".

I add numeric variables to control the order of the bars, and the order
of the colored segments, and then I use a user-defined format to make
the values of the text (country name & expenditure category) show up
in the graph rather than the numeric ordering values.

I use custom axis and legend statements to "justify" the text so it is
close to the bars/colors.

I use "space=0" between the bars.

I add html "data tips", so you can hover your mouse over the bar segments, 
and see the exact country/category/%-value represented by the bar segments.

I then use a similar gchart, with a "by" statement, to produce separate 
charts for each of the expenditure categories, so you can do comparative
analyses between the countries for each individual category.

Back to Samples Index