/
chartArea4.json
75 lines (66 loc) · 1.63 KB
/
chartArea4.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
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"title": {
"text": "Price distributions - pick an item",
"subtitle":["Prices (£), colours set by decile for the 10th to 90th deciles"],
"subtitleFontStyle":"italic",
"subtitleFontSize":10,
"subtitlePadding":5,
"anchor": "start",
"color": "black"
},
"width": 300,
"height": 300,
"data": {"url": "https://raw.githubusercontent.com/RDeconomist/prices/master/analysis/newItems_Updated2024.csv"},
"transform": [
{"filter": {"selection": "chooseItem"}},
{
"filter": {
"field": "price",
"oneOf": ["10", "1020", "2030", "3040", "4050", "5060", "6070", "7080", "8090"]
}
}
],
"selection": {
"chooseItem": {
"type": "single",
"init": {"itemName": "Pub meal"},
"fields": ["itemName"],
"bind": {
"input": "select",
"options": [
"Cigarettes",
"Lettuce",
"Men's socks",
"Pub meal"
],
"name": "Pick an item:"
}
}
},
"mark": {
"type":"area",
"orient":"vertical",
"opacity": 0.7
},
"encoding": {
"x": {
"field": "newDate",
"type": "temporal",
"title": null
},
"y": {
"aggregate":"sum",
"field": "p",
"type": "quantitative",
"title":null
},
"color": {
"legend":null,
"field": "price",
"scale": {"range": [null, "#D9D9F3", "#00BFFF", "#0276FD", "#000080", "#000080", "#0276FD", "#00BFFF", "#D9D9F3" ]}
},
"order": {"field": "price"}
},
"resolve": {"scale": {"y": "independent"}}
}