forked from yuankunzhang/charming
-
Notifications
You must be signed in to change notification settings - Fork 0
/
basic_parallel.rs
30 lines (29 loc) · 892 Bytes
/
basic_parallel.rs
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
use charming::{
component::ParallelAxis,
df,
element::{AxisType, LineStyle},
series::Parallel,
Chart,
};
pub fn chart() -> Chart {
Chart::new()
.parallel_axis(ParallelAxis::new().dim(0).name("Price"))
.parallel_axis(ParallelAxis::new().dim(1).name("Net Weight"))
.parallel_axis(ParallelAxis::new().dim(2).name("Amount"))
.parallel_axis(
ParallelAxis::new()
.dim(3)
.name("Score")
.type_(AxisType::Category)
.data(vec!["Excellent", "Good", "OK", "Bad"]),
)
.series(
Parallel::new()
.line_style(LineStyle::new().width(4))
.data(df![
[12.99, 100, 82, "Good"],
[9.99, 80, 77, "OK"],
[20, 120, 60, "Excellent"],
]),
)
}