fixed the layout and also chart drawing problem