AI-Powered Chart Flow
AI-Powered Chart lets your users build and update Vaadin Charts visualizations by typing in natural language. The ChartAIController from the AI Support module wires an AIOrchestrator to a Chart and a DatabaseProvider, so an LLM can inspect the database schema, write SQL queries, and update the Highcharts configuration on the fly.
Source code
Java
Chart chart = new Chart();
MessageInput messageInput = new MessageInput();
DatabaseProvider databaseProvider = new JdbcDatabaseProvider(dataSource);
ChartAIController controller = new ChartAIController(chart, databaseProvider);
AIOrchestrator.builder(provider, systemPrompt)
.withInput(messageInput)
.withController(controller)
.build();
add(messageInput, chart);Example prompts:
-
"Plot monthly revenue for the last year as a column chart."
-
"Show revenue by region as a pie chart."
-
"Compare 2025 and 2026 quarterly sales side-by-side with a legend."
For the full guide — including state persistence, custom data conversion, and combining several charts with the Dashboard component — see AI-Powered Chart in the AI Support section. The same approach is available for tabular data via AI-Powered Grid.