charts-rs
charts-rs is a charting library for rust. It's simple and fast.
Overview
charts-rs is simpler way for generating charts, which supports svg and png format and themes: light, dark, grafana, ant, vintage, walden, westeros, chalk and shine. The default theme is light. These charts are supported: Bar, HorizontalBar, Line, Pie, Radar, Scatter, Candlestick, Table and MultiChart.
Apache ECharts is popular among Front-end developers, and charts-rs reference it. Developers can generate charts almost the same as Apache ECharts.
Themes
Feature
- Multiple themes for all charts
- Load font family from ttf or otf
- Smooth, fill, mark point and mark line for line chart
- Multiple legends for all charts, for example:
round rect,circleandrect - Supports two y axises, which are useful
- New from json is simple and easy
- Svg, png, jpeg, webp and avif format support more available scenarios
- Web json editor to try using more options by one step
Demo
You can try to use the web demo page, it's simple and useful.
Charts Web Demo Page: https://charts.npmtrend.com/
Charts Web Source: https://github.com/vicanso/charts-rs-web
Mix line bar
Horizontal bar
Line
Pie
Radar
Scatter
Candlestick
Table
Multi Chart
Example
New from option
use ;
let mut bar_chart = new_with_theme;
bar_chart.title_text = "Mixed Line and Bar".to_string;
bar_chart.legend_margin = Some;
bar_chart.series_list.category = Some;
bar_chart.series_list.y_axis_index = 1;
bar_chart.series_list.label_show = true;
bar_chart
.y_axis_configs
.push;
bar_chart.y_axis_configs.axis_formatter = Some;
bar_chart.y_axis_configs.axis_formatter = Some;
println!;
svg_to_png.unwrap;
From json
use ;
let bar_chart = from_json.unwrap;
println!;
svg_to_png.unwrap;
License
This project is licensed under the Apache License 2.0 license.