Rely on jquery.html() for appending the legends in the container