HUE-2300 [search] Fix legend JS error