Repolode
vicanso

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. 1

    Add the crate to Cargo.toml

    [dependencies] charts-rs = "2"
  2. 2

    Build a chart in Rust and render it to SVG

    let svg = chart.svg().unwrap();
  3. 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