adding reusable chart script
updated