use charton::prelude::*;
use polars::prelude::*;
use std::error::Error;
fn main() -> Result<(), Box<dyn Error>> {
let df = df![
"x" => [1.0, 2.0, 3.0, 4.0, 5.0],
"y" => [2.0, 3.0, 1.0, 4.0, 2.0],
"y2" => [4.0, 5.0, 3.0, 6.0, 4.0],
"color" => ["A", "B", "A", "B", "A"]
]?;
let chart = Chart::build(&df)?
.mark_rule()?
.encode((x("x"), y("y"), y2("y2"), color("color")))?
.with_title("Rule Chart with Y and Y2")
.with_x_label("X Values")
.with_y_label("Y Values");
chart.save("docs/src/images/rule.svg")?;
Ok(())
}