decorator for shared bar chart code