-
Notifications
You must be signed in to change notification settings - Fork 0
/
Chart4.json
100 lines (100 loc) · 2.95 KB
/
Chart4.json
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
97
98
99
100
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"title": {
"text": "Scatter Plot Between Sanitation (left), Undernourishment (right), and Life Expectancy",
"anchor": "middle",
"fontSize": 16
},
"width": 400,
"height": 300,
"data": {
"url": "https://raw.githubusercontent.com/sz0314/life_expansion/main/life%20expectancy.csv",
"format": {"type": "csv"}
},
"hconcat": [
{
"width": 400,
"height": 300,
"layer": [
{
"mark": {"type": "point", "filled": true, "tooltip": true},
"encoding": {
"x": {
"field": "Sanitation",
"type": "quantitative",
"scale": {"domain": [0, 100]},
"title": "Sanitation [%]"
},
"y": {
"field": "Life Expectancy World Bank",
"type": "quantitative",
"scale": {"domain": [40, 100]},
"title": "Life Expectancy [yrs]"
},
"color": {
"field": "Region",
"type": "nominal",
"legend": {"title": "Region"}
},
"tooltip": [
{"field": "Country Name", "title": "Country Name"},
{"field": "Sanitation", "title": "Sanitation [%]"},
{
"field": "Life Expectancy World Bank",
"title": "Life Expectancy [yrs]"
}
]
},
"transform": [
{"filter": "datum['Sanitation'] > 0"},
{"filter": "datum['Life Expectancy World Bank'] >= 20"}
]
}
]
},
{
"width": 400,
"height": 300,
"layer": [
{
"mark": "point",
"encoding": {
"x": {
"field": "Prevelance of Undernourishment",
"type": "quantitative",
"scale": {"zero": false},
"title": "Prevalence of Undernourishment [%]"
},
"y": {
"field": "Life Expectancy World Bank",
"type": "quantitative",
"scale": {"zero": false},
"title": "Life Expectancy [yrs]"
},
"color": {
"field": "Region",
"type": "nominal",
"legend": {"title": "Region"}
},
"tooltip": [
{"field": "Country Name", "title": "Country Name"},
{
"field": "Prevelance of Undernourishment",
"title": "Prevalence of Undernourishment [%]"
},
{
"field": "Life Expectancy World Bank",
"title": "Life Expectancy [yrs]"
}
]
},
"transform": [
{"filter": "datum['Prevelance of Undernourishment'] > 0"},
{"filter": "datum['Life Expectancy World Bank'] >= 20"}
]
}
]
}
],
"config": {"legend": {"orient": "bottom"}}
}