add YUI doc for the function

The YUI doc is added for the function legend