Graph button function issue