Add per-expression legend string functionality