trim code in bar-chart.js