legend and renderHTML added