Add functions for graph buttons