toggle legend works