update graph labels when the values are changed