modified activnsAtBarchart to make it more flexible