IChart2Code: Benchmarking Multimodal Large Language Models for Interactive Chart Code Generation
Xu Zhang, Hongzhang Zheng, Zhili Huang, Yaoyi Wang, Ling Xu, Sheng Huang
Abstract
Interactive chart code generation requires models to reproduce a reference chart's appearance and underlying data and correctly implement the state changes triggered by specified user interactions. Existing chart-to-code benchmarks focus on static outputs and lack task representations or evaluation protocols for interaction specification, browser execution, and post-interaction verification. We introduce IChart2Code, a benchmark comprising 377 tasks across 20 chart forms and 13 data families, with 1209 interaction requirements in six families. Each task provides a reference screenshot, task-local data, and natural-language interaction requirements, with executable HTML/JavaScript code as the target output. We further develop a browser-based evaluation protocol with an Executability gate and three rubric-guided dimensions: Data Fidelity, Static Visual Correctness, and Interaction Correctness. The protocol tests runtime viability, consistency with task-local data, fidelity of the initial rendering to the reference screenshot, and interaction-induced state changes in a sandboxed browser. A rubric-guided MLLM judge evaluates task-specific items for the three scored dimensions using the collected browser observations and achieves an overall item-level F1 score of 0.8844 against adjudicated human labels. We also propose TRAIL, a trajectory-guided dual-agent framework for interactive chart code generation. An Inspector derives task-specific inspection checks, executes them in the browser, and uses the resulting trajectories to diagnose failures and produce structured repair feedback. Averaged across four MLLMs, TRAIL improves the four evaluation dimensions over direct prompting by 7.89, 4.98, 3.45, and 4.47 percentage points, respectively.
Create a lesson
Metadata
- Comments
- 9 pages, 3 figures, 5 tables
Related papers
Codit-Bench - Can Large Language Models Find Bugs in Code Auditing?
Shared title terminologycs.SEYuesong Feng, Zheng Zhang, Haoran Ding et al.
RBioBench: an execution-based benchmark for biomedical R code generation
Shared title terminologycs.SEXihao Piao, Dong Wang, Ziwei Yang et al.
MintEval: Do LLMs Implement the Trading Strategy You Asked For? A Behavioural-Equivalence Benchmark for Natural-Language-to-Strategy Code
Shared title terminologycs.SESiyu Wang, Yifan Wang, Yuecheng He
WebUIProof: Benchmarking WebUI Code Generators with UI-Agent Execution Harness
Shared title terminologycs.SEYun-Yun Tsai, Yuning Mao, Shiqi Wang et al.
Path2Spec: Path-Aware Specification Generation via Large Language Models
Shared title terminologycs.SEDan Huang, Zhensu Sun, Huihui Huang et al.
Beyond Rule-Based Mutation Testing: Test-Aware Mutant Generation Using Large Language Models
Shared title terminologycs.SENils Kiele, Zainab Saad, Zirui Wang et al.