The following R snippet
library(ggplot2)
library(reshape2)
data <- data.frame(
          item  = c('foo', 'bar', 'baz'),
          val_1 = c(   7 ,    9 ,    3 ),
          val_2 = c(   1 ,    2 ,    3 )
        );
data
data$tot = data$val_1 + data$val_2;
data.molten = melt(data);
ggplot(
   data = data.molten,
   aes(x = variable, y = item ))  +
   geom_tile(aes(fill  = value))  +
   geom_text(aes(label = value))
produces
Is there a possibility to have it ordered by the value of tot descending so that row with bar is at the top and baz is at the bottom.

 
     
     
    