adding function for graph.bar