A CLI that renders terminal charts (ASCII, sparklines, bars, columns, heatmaps, braille, SVG) from plain numeric text input.
vicanso/charts-rs
A Rust charting library that renders 29 chart types as SVG or PNG/JPEG/WebP/AVIF, with no browser required.
Open-source alternative to:Apache ECharts
- Stars
- 400
- Forks
- 25
- Open issues
- 1
- Last commit
- 4 days ago
What is it?
charts-rs is a charting library for Rust that generates charts as SVG and can also export them as PNG, JPEG, WebP or AVIF images. Charts are built either through a typed Rust API or from a JSON document with the same options, modeled on Apache ECharts. It is aimed at server-side rendering for reports, emails, bots and dashboards, since no headless browser or Node.js is needed.
The library supports 29 chart types, including bar, line, pie, radar, candlestick, heatmap, sankey, gantt, treemap and map charts, and can place several of them on one canvas with MultiChart. Series can be stacked, mixed across two y axes, or drawn with smooth lines, areas and error bars. Axes support category, value, time and logarithmic scales.
Output styling includes ten built-in themes, custom fonts (TTF, OTF, TTC) with CJK support, legends, tooltips and SVG animation. Image export is enabled through Cargo feature flags such as png, jpeg, webp and avif.
Key features
- 01Renders 29 chart types, from bars and lines to candlesticks, sankey and maps.
- 02Builds charts with a typed Rust API or from a JSON document.
- 03Exports SVG, and PNG, JPEG, WebP or AVIF images via feature flags.
- 04Offers ten built-in themes and supports custom fonts including CJK.
- 05Combines several charts on one canvas with MultiChart.
Use cases
- Generating chart images for scheduled reports or PDF exports on a server.
- Attaching charts to emails or chat bot messages without a browser.
- Rendering dashboard charts in a Rust backend API response.
- Producing charts from JSON configuration stored alongside application data.
Quick start
- 1
Add the crate to Cargo.toml
[dependencies] charts-rs = "2" - 2
Build a chart in Rust and render it to SVG
let svg = chart.svg().unwrap(); - 3
For PNG output, enable the png feature
charts-rs = { version = "2", features = ["png"] }
Things to know
- Requires Rust 1.88 or newer (edition 2024).
Topics
FAQ
- What is charts-rs?
- A Rust charting library that renders 29 chart types as SVG or PNG/JPEG/WebP/AVIF, with no browser required. charts-rs is a charting library for Rust that generates charts as SVG and can also export them as PNG, JPEG, WebP or AVIF images. Charts are built either through a typed Rust API or from a JSON document with the same options, modeled on Apache ECharts. It is aimed at server-side rendering for reports, emails, bots and dashboards, since no headless browser or Node.js is needed.
- Is charts-rs free to use? What license does it have?
- charts-rs is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
- Is charts-rs still maintained?
- Actively maintained. The last commit to charts-rs was on Oct 17, 2026.
- What can I use charts-rs for?
- Generating chart images for scheduled reports or PDF exports on a server. Attaching charts to emails or chat bot messages without a browser. Rendering dashboard charts in a Rust backend API response. Producing charts from JSON configuration stored alongside application data.
- How do I install charts-rs?
- Add the crate to Cargo.toml: [dependencies] charts-rs = "2" Build a chart in Rust and render it to SVG: let svg = chart.svg().unwrap(); For PNG output, enable the png feature: charts-rs = { version = "2", features = ["png"] }
- Where can I get charts-rs?
- The source code and installation instructions are on GitHub: https://github.com/vicanso/charts-rs
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Open-source Rust tool that converts raster images like JPG and PNG into compact SVG vector graphics, usable as a CLI, desktop app, or library.
A declarative engine that generates and renders SVG infographics from a text syntax, designed for AI-driven generation and streaming output.
A visualization intermediate language that lets AI agents turn compact chart specs into polished charts for Vega-Lite, ECharts, Chart.js, Plotly, or Excel.
Open-source web app that connects to databases and APIs to build live, shareable, embeddable dashboards and charts.
A small, synchronous renderer that turns Mermaid diagram text into SVG with no runtime dependencies.