Make legends on term panel clickable

Closes #1034