This example demonstrates some of the different map legend docking options.

Legend Docking

 
 

Example Controls

Legend Dock Position: