1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/// An enumeration representing the orientation of the legend.
///
/// # Example
///
/// ```rust
/// use polars::prelude::*;
/// use plotlars::{BarPlot, Legend, Orientation, Plot, Rgb};
///
/// let dataset = df![
/// "animal" => &["giraffe", "giraffe", "orangutan", "orangutan", "monkey", "monkey"],
/// "gender" => &vec!["female", "male", "female", "male", "female", "male"],
/// "value" => &vec![20.0f32, 25.0, 14.0, 18.0, 23.0, 31.0],
/// "error" => &vec![1.0, 0.5, 1.5, 1.0, 0.5, 1.5],
/// ]
/// .unwrap();
///
/// let legend = Legend::new()
/// .orientation(Orientation::Horizontal)
/// .y(1.1)
/// .x(0.3);
///
/// BarPlot::builder()
/// .data(&dataset)
/// .labels("animal")
/// .values("value")
/// .orientation(Orientation::Horizontal)
/// .group("gender")
/// .error("error")
/// .colors(vec![Rgb(255, 127, 80), Rgb(64, 224, 208)])
/// .legend(&legend)
/// .build()
/// .plot();
/// ```
///
/// 