update graph when you click on the image as well as the text