merge legend (from legend.html)