Fixed

Moved elements for colorpicker to correct location
Fixed problems with Legend array
Using JS libraries (pre)registered with WP