Want charts straight from your backend, without dragging a browser along?
Try charts-rs: 27 chart types, straight to SVG. Need an image instead? PNG, JPEG, WebP and AVIF all work.
A bar chart takes 41 µs as SVG and 1.7 ms as PNG.
vicanso/charts-rs
#rustlang #dataviz
Most charts you'd reach for are there, 27 in all:
bar, line, pie, scatter, radar, candlestick, heatmap, funnel, waterfall, gauge, treemap, box plot, sunburst, sankey, tree, graph, histogram, chord, gantt, map, calendar, table...
Several in one picture? That works too.
How fast? Fast enough to draw a fresh one for every request (M4 Pro, one thread, 600x400):
bar: SVG 41 µs, PNG 1.7 ms
pie: SVG 52 µs, PNG 1.4 ms
sankey: SVG 71 µs, PNG 1.2 ms
line, 2 x 100 points: SVG 158 µs, PNG 3.4 ms
No headless Chrome to spin up, no Node.js to babysit.
Where SVG can be shown, send SVG: sharp however far you zoom, small, and you can add hover tooltips.
Where it can't (e-mail, chat apps, PDFs), send an image: PNG, JPEG, WebP or AVIF, any size you like, 2x included. Bring your own fonts; CJK works fine.
Where it fits in:
- alerts and bot messages with a chart (Slack, Telegram, Discord)
- daily and weekly e-mail reports
- PDF and Word exports
- server-rendered dashboards
- CLI tools and cron jobs
Write Rust, or just hand it some JSON, handy when the config comes in a req
Don't feel like installing anything? Play with it in the browser:
charts.npmtrend.com
All the charts, the guide and the benchmark numbers are here:
vicanso/charts-rs
2 likes · 1 repost · 28 views
Mentions
charts-rs 是一款纯 Rust 编写的开源服务端图表库。 它无需安装浏览器或 Node.js,只需几行 Rust 代码或一份 JSON 配置,就能在服务端直接生成 29 种图表的 SVG,也可以导出 PNG、JPEG、WebP、AVIF,风格参考 Apache ECharts。 vicanso/charts-rs t.co
Want charts straight from your backend, without dragging a browser along? Try charts-rs: 27 chart types, straight to SVG. Need an image instead? PNG, JPEG, WebP and AVIF all work. A bar chart takes 41 µs as SVG and 1.7 ms as PNG. vicanso/charts-rs #rustlang #dataviz Most charts you'd reach for are there, 27 in all: bar, line, pie, scatter, radar, candlestick, heatmap, funnel, waterfall, gauge, treemap, box plot, sunburst, sankey, tree, graph, histogram, chord, gantt, map, calendar, table... Several in one picture? That works too. How fast? Fast enough to draw a fresh one for every request (M4 Pro, one thread, 600x400): bar: SVG 41 µs, PNG 1.7 ms pie: SVG 52 µs, PNG 1.4 ms sankey: SVG 71 µs, PNG 1.2 ms line, 2 x 100 points: SVG 158 µs, PNG 3.4 ms No headless Chrome to spin up, no Node.js to babysit. Where SVG can be shown, send SVG: sharp however far you zoom, small, and you can add hover tooltips. Where it can't (e-mail, chat apps, PDFs), send an image: PNG, JPEG, WebP or AVIF, any size you like, 2x included. Bring your own fonts; CJK works fine. Where it fits in: - alerts and bot messages with a chart (Slack, Telegram, Discord) - daily and weekly e-mail reports - PDF and Word exports - server-rendered dashboards - CLI tools and cron jobs Write Rust, or just hand it some JSON, handy when the config comes in a req Don't feel like installing anything? Play with it in the browser: charts.npmtrend.com All the charts, the guide and the benchmark numbers are here: vicanso/charts-rs