Crate chartjs_image

Crate chartjs_image 

Source
Expand description

Render Chart.JS as Image (or URL of Image)

Generate Chart.JS charts as image and embed them everywhere in emails, pdf reports, chat bots…!

§Features

  • async (default): Async API using tokio and reqwest
  • blocking: Blocking/synchronous API using reqwest blocking
  • full: Both async and blocking APIs

§Example

use chartjs_image::ChartJSImage;

let url = ChartJSImage::new()
    .chart(r#"{"type":"bar","data":{"labels":["Q1","Q2"],"datasets":[{"data":[1,2]}]}}"#)
    .width("400")
    .height("300")
    .to_url();

println!("{}", url);

Structs§

ChartJSImage
Builder for Chart.JS to Image API requests
ChartJSImageBuilder
Builder for ChartJSImageConfig
ChartJSImageConfig
Configuration for ChartJSImage client
ChartJSImageError
Error type for ChartJSImage operations