Adapted category-legend.

Fixes to histogram--still in progress