LieCharts
Overview
A Rust library for creating charts, inspired by ECharts.
Features
- Multiple Chart Types: Line, Bar, Pie, Area, Scatter, Radar, Gauge, Candlestick, Polar Bar, Polar Scatter, Table.
- Double Rendering Engines: PNG/JPEG and SVG.
- Theme System: customizable themes.
- JSON Configuration: configurable JSON configuration.
- Complex Layouts: Mixed charts, multiple Y axes, and more.
Usage
Builder API (Recommended)
use *;
JSON Configuration
use ChartBuilder;
let json = r#"{
"title": { "text": "月度趋势" },
"xAxis": [{ "type": "category", "data": ["1月", "2月", "3月"] }],
"yAxis": [{ "type": "value" }],
"series": [{ "type": "bar", "name": "销售额", "data": [120, 200, 150] }]
}"#;
from_option_json?
.build?
.render_to_image?;
Examples
Check the examples directory. Run with: cargo run --example <name>
Online Demo: https://zzzdong.github.io/liecharts
License
Apache-2.0