close graph panel when last graph is closed