Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Charming - A Rust Visualization Library
Charming is a powerful and versatile chart rendering library for Rust that leverages the power of Apache ECharts to deliver high-quality data visualizations. Built with the Rust programming language, this library aims to provide the Rust ecosystem with an intuitive and effective way to generate and visualize charts, using a declarative and user-friendly API.
Highlights:
- Easy-to-use, declaritive API.
- Rich and customizable chart themes and styles.
- Rendering to multiple formats, including HTML, SVG, PNG, and JPEG.
- Abundant chart types.
Themes
Renderers
Charming provides two types of renderers:
HtmlRenderer- It generates HTML fragments and offloads the actual rendering to user's browser for an interactive, seamless experience.ImageRenderer- It has the ability to generates static images. This renderer is disabled by default, to enable it, add thessrfeature in yourCargo.toml.
// Use HtmlRenderer.
use HtmlRenderer;
// Chart dimension 1000x800.
let renderer = new;
// Render the chart as HTML string.
let html_str = renderer.render.unwrap;
// Save the chart as HTML file.
renderer.save.unwrap;
// Use ImageRenderer. The `ssr` feature needs to be enabled.
use ;
// Chart dimension 1000x800.
let mut renderer = new;
// Render the chart as SVG string.
renderer.render.unwrap;
// Render the chart as PNG bytes.
renderer.render_format.unwrap;
// Save the chart as SVG file.
renderer.save.unwrap;
// Save the chart as PNG file.
renderer.save_format;
Basic Usage
Add charming as a dependency:
Below is an example of drawing a simple pie chart.
use ;
This code creates the following SVG file:
As another example, the code file gallery/src/dataset/encode_and_matrix.rs draws a complex chart with four sub-charts:
Gallery
Here are some selected chart examples. Click on any single chart to view its source code file.
You can also clone the repo and run cargo run --bin gallery to view the interactive charts on the rendered HTML page.