Evaluating LLMs for Visualization Generation and Understanding