Add rudimentary legend functionality