code in barChart.js