bug in js that generated legend. fixed.