Chart-Generator¶
Chart-Generator is a web application for generating interactive data visualisations from CSV and Excel files through natural-language requests. Instead of single-step code generation, it uses an agentic pipeline that decomposes a request into several processing stages: intent recognition, execution planning, and controlled execution of the generated code. The pipeline relies on an externally provided, OpenAI-compatible LLM endpoint and combines it with code patterns, validation, and a fallback mechanism.
At a glance¶
- Upload CSV and Excel files and visualise them without programming knowledge.
- Request charts in natural language (for example, "Show top 10 as a bar chart").
- Iteratively refine existing charts, for example by changing colours, labels, or axes.
- Visualise multiple sheets of an Excel workbook in a single step.
- Obtain suggestions for suitable visualisations derived from the uploaded data.
- Export charts as interactive HTML or as PNG.
- Access a chart history of the last ten visualisations per session.
Highlights¶
In contrast to a direct LLM prompt or a simple generator script, Chart-Generator decomposes each request into clearly separated steps and validates their results. As a consequence, typical failure modes of LLM-based code generation are detected, corrected, or compensated for at an earlier stage.
- Three-stage agentic pipeline. Each request passes through three specialised services: intent recognition (classification of the user's goal), plan creation (selection of chart type, columns, and aggregation), and execution (code generation and execution). The separation enables targeted prompts and traceable intermediate results.
- Pattern and anti-pattern library. Validated code templates exist for common chart types, aggregations, and modifications. Anti-patterns describe typical errors (such as missing
dropnaor invalid parameters) that the LLM is instructed to avoid. - Semantic colour validation. Requests such as "red for negative values" or traffic-light colour schemes are recognised and translated into an explicit category-to-colour mapping rather than positional colour palettes.
- Automatic error correction. If code execution fails, the error is fed back to the LLM and the code is revised in up to three iterations. Only after that does a fallback take effect.
- Seaborn fallback. If Plotly-based generation fails despite correction attempts, a Seaborn variant with a reduced feature set takes over so that a visualisation can be produced in most cases.
- Sandboxed execution of generated code. The generated Python code runs in a restricted environment with a defined set of built-ins and without import capability.
- Multi-sheet processing. For Excel workbooks, dedicated plans are created per sheet; a request "for all sheets" produces matching charts for each sheet in parallel.
- Connection to two data sources: CSV (with automatic detection of delimiters and character encoding) and Excel (
.xlsx,.xls, multiple sheets). - Configurable processing limits. File size, row and column limits, the number of LLM calls per request, and retry behaviour can be configured via environment variables.
- Session-based chart history. Generated charts are kept per session including source code, request, and metadata, and can be reloaded.