use charton::prelude::*;
use polars::prelude::*;
use std::error::Error;
#[test]
fn test_text_1() -> Result<(), Box<dyn Error>> {
let df = df! [
"GDP" => [21.43, 14.34, 5.31, 4.94, 3.87, 3.75], "Population" => [331.9, 143.9, 1380.0, 279.6, 67.2, 67.0], "Country" => ["USA", "Russia", "China", "Brazil", "UK", "France"],
"Continent" => ["North America", "Europe", "Asia", "South America", "Europe", "Europe"]
]?;
Chart::build(&df)?
.mark_text()?
.configure_text(|t| t.with_size(16.0))
.encode((
x("GDP"),
y("Population"),
text("Country"),
color("Continent"),
))?
.with_size(600, 400)
.with_x_label("GDP (Trillion USD)")
.with_y_label("Population (Millions)")
.coord_flip()
.save("./tests/text_1.svg")?;
Ok(())
}