Abstract
We introduce Chart2Code, a new benchmark for evaluating the chart understanding and code generation capabilities of large multimodal models (LMMs). Chart2Code is explicitly designed from a user-driven perspective, capturing diverse real-world scenarios and progressively increasing task difficulty. It consists of three levels: Level 1 (Chart Reproduction) reproduces charts from a reference figure and user query; Level 2 (Chart Editing) involves complex modifications such as changing chart types or adding elements; and Level 3 (Long-Table to Chart Generation) requires models to transform long, information-dense tables into faithful charts following user instructions. In total, Chart2Code contains 2,023 tasks across 22 chart types, paired with multi-level evaluation metrics that assess both code correctness and the visual fidelity of rendered charts. We benchmark 25 state-of-the-art (SoTA) LMMs, including GPT-5, Qwen2.5-VL, and InternVL3.5. Experimental results demonstrate that even the SoTA model GPT-5 averages only 0.57 on code-based evaluation and 0.22 on chart-quality assessment across editing tasks, underscoring the difficulty of Chart2Code.
Introduction
As Large Multimodal Models (LMMs) advance, the potential for AI assistants to automate scientific and business visualizations—a task known as chart2code—becomes increasingly tangible. However, existing benchmarks are facing "performance saturation," where frontier models like GPT-4o score so high that they fail to distinguish between incremental improvements in multimodal reasoning.
Furthermore, real-world usage extends beyond simple reproduction. Users frequently need to edit existing figures or distill massive, unformatted datasets into clean visuals. Chart2Code addresses this gap by introducing a systematic, hierarchical framework to evaluate these demanding, human-AI interactive scenarios where models must reason across long contexts and maintain high visual precision.
Methodology and Dataset Design
The Chart2Code benchmark is structured into three levels of increasing complexity:
- Level 1 (Chart Reproduction): Models must mimic a reference figure using either the image alone or provided raw data.
- Level 2 (Chart Editing): Models perform complex modifications, such as changing chart types (e.g., from a bar chart to a radar chart), adding trend lines, or re-categorizing data.
- Level 3 (Long-Table to Chart): The most difficult tier, requiring models to ingest long, unprocessed tables (e.g., Excel files with thousands of rows) and generate faithful charts based on natural language instructions.
The dataset comprises 2,186 tasks across 22 chart families, utilizing 5,000 paper charts from Arxiv (2024-2025) and raw data from Kaggle and corporate annual reports. To evaluate these tasks, the researchers developed a multi-dimensional framework including Code Executable Rate (ER), a rule-based Base-Score for structural elements, and an LMM-Score that uses a vision model to compare the rendered output against the ground truth for visual fidelity.
Key Insights: The Fidelity Gap
A primary finding of this research is that execution does not equal fidelity. While top-tier proprietary models often achieve near 100% execution rates, their visual fidelity scores (LMM-Score) frequently fall below 40%. Models can write syntactically correct code that produces visually flawed charts—featuring overlapping labels, incorrect axis scaling, or missing data series.
The Challenge of Long-Table Data
Level 3 proved to be a significant bottleneck for all tested models. The requirement to simultaneously process extremely long textual inputs (raw data) and reference images while extracting precise plotting requirements led to a collapse in performance. Even the most advanced models saw their execution rates plummet to approximately 20% on these tasks.
Benchmarking Results
The study evaluated 29 state-of-the-art LMMs. Proprietary models currently lead the field significantly, though they still struggle with visual precision. For Level 2 editing, GPT-5.2 achieved a 96.04% execution rate but only a 33.03 LMM-Score. Open-source models, such as Qwen2.5-VL-72B, face a steeper challenge, with visual fidelity scores often dropping below 17 on complex editing tasks.
Conclusion and Future Work
Chart2Code reveals that while LMMs are becoming proficient coders, they are not yet reliable visual designers. Future development must focus on closing the "fidelity gap" and improving long-context reasoning for data visualization. The authors suggest that future iterations of the benchmark should explore multi-turn "render-then-verify" loops, where models can inspect their own rendered output and iteratively correct visual artifacts, as well as expanding support for multilingual chart generation.
Summary updated