Cleaned up some code in the bar chart directive