-
Notifications
You must be signed in to change notification settings - Fork 77
/
multiple_radar.rs
96 lines (95 loc) · 3.03 KB
/
multiple_radar.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
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
use charming::{
component::{Legend, RadarCoordinate, Title},
element::{AreaStyle, Tooltip, Trigger},
series::Radar,
Chart,
};
pub fn chart() -> Chart {
Chart::new()
.title(Title::new().text("Multiple Radar"))
.tooltip(Tooltip::new().trigger(Trigger::Axis))
.legend(Legend::new().left("center").data(vec![
"A Software",
"A Phone",
"Another Phone",
"Precipitation",
"Evaporation",
]))
.radar(
RadarCoordinate::new()
.indicator(vec![
("Brand", 0, 100),
("Content", 0, 100),
("Usability", 0, 100),
("Function", 0, 100),
])
.center(vec!["25%", "40%"])
.radius(80.0),
)
.radar(
RadarCoordinate::new()
.indicator(vec![
("Look", 0, 100),
("Photo", 0, 100),
("System", 0, 100),
("Performance", 0, 100),
("Screen", 0, 100),
])
.center(vec!["50%", "60%"])
.radius(80.0),
)
.radar(
RadarCoordinate::new()
.indicator(vec![
("1月", 0, 100),
("2月", 0, 100),
("3月", 0, 100),
("4月", 0, 100),
("5月", 0, 100),
("6月", 0, 100),
("7月", 0, 100),
("8月", 0, 100),
("9月", 0, 100),
("10月", 0, 100),
("11月", 0, 100),
("12月", 0, 100),
])
.center(vec!["75%", "40%"])
.radius(80.0),
)
.series(
Radar::new()
.name("Radar")
.tooltip(Tooltip::new().trigger(Trigger::Item))
.area_style(AreaStyle::new())
.data(vec![(vec![60, 73, 85, 40], "A Software")]),
)
.series(
Radar::new()
.radar_index(1)
.area_style(AreaStyle::new())
.data(vec![
(vec![85, 90, 90, 95, 95], "A Phone"),
(vec![95, 80, 95, 90, 93], "Another Phone"),
]),
)
.series(
Radar::new()
.radar_index(2)
.area_style(AreaStyle::new())
.data(vec![
(
vec![
2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 75.6, 82.2, 48.7, 18.8, 6.0, 2.3,
],
"Precipitation",
),
(
vec![
2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 35.6, 62.2, 32.6, 20.0, 6.4, 3.3,
],
"Evaporation",
),
]),
)
}