This demonstrates how to add an interactive legend using events such as `onMouseOver`, `onMouseOut`, and `onClick`