charton 0.4.1

A high-level, layered charting system for Rust, designed for Polars-first data workflows and multi-backend rendering.
Documentation
use charton::prelude::*;
use polars::prelude::*;
use std::error::Error;

fn main() -> Result<(), Box<dyn Error>> {
    // Create sample data frame for donut chart
    let df = df![
        "category" => ["A", "B", "C", "E", "D", "E"],
        "value" => [25.0, 30.0, 15.0, 30.0, 20.0, 10.0]
    ]?;

    // Create donut chart
    let donut = Chart::build(&df)?
        .mark_bar()?
        .encode((
            x(""),             // x encoding for donut chart (empty string for donut chart)
            y("value"),        // theta encoding for donut slices
            color("category"), // color encoding for different segments
        ))?
        .with_coord(CoordSystem::Polar)
        .with_inner_radius(0.5);

    donut.save("docs/src/images/donut.svg")?;

    Ok(())
}