script changed for bar Graph