graph changes on button click