added logic to build singleBar chart data