adding graph in canvas