AI Can Now Turn a Chart Screenshot Into Working Interactive Code
This could save analysts an afternoon of fiddly chart-building work.
Charts on websites aren't just pictures. They're small programs. Hover over a bar and a number pops up; click a dropdown and the chart redraws itself. A team of researchers has released the first serious test of whether AI can do that whole job: look at a screenshot of a chart and write the code that rebuilds it — data, colors, and interactions included. The test, called IChart2Code, contains 377 chart tasks across 20 chart styles and 13 kinds of data, with 1,209 specific interactive requirements built in.
The results are a reality check. Today's best AI models — the kind that can already "see" images and write code — handle the easy part reasonably well: matching how a static chart looks. Then they fall down. They get the underlying numbers wrong, misplace labels, and often can't make the interactivity work once the code actually runs in a web browser. The researchers judged every attempt inside a real browser, so a chart that looks right but breaks when you click it earns no credit.
To help, the team built a tool called TRAIL. Think of it as giving the AI a proofreader: a second AI "Inspector" writes a checklist, runs the code in a browser, watches what happens, and hands back specific repair notes — "the tooltip shows up in the wrong corner," that kind of thing. Averaged across four different AI models, TRAIL lifted scores by roughly 3 to 8 percentage points depending on the category. That's real progress, but not a leap.
Why should you care? Building an interactive chart is fiddly, tedious work — the sort of thing an analyst, marketer, or data journalist might lose an afternoon to. If AI can hand back a rough first draft in seconds, that's genuine time returned to you. But because the models still get numbers and interactions wrong, a person has to double-check the output. And a chart with a wrong number is far worse than a chart that's merely ugly, because it looks so authoritative.
- AI can already copy how a chart looks from a screenshot, but it frequently gets the numbers behind the chart wrong.
- Interactivity is the hardest part — the test includes 1,209 requirements like hover, click, and filter actions that AI mostly fails.
- A two-AI 'check your own work' setup improved results by up to 8 percentage points, but a human still needs to verify the data.
Why It Matters
It could cut hours of tedious chart-building for analysts, but you'll still need to check the numbers.